奇怪,php.5.2.14配置后不能连接mysql?解决办法

WBOY
Release: 2016-06-13 13:33:30
Original
722 people have browsed it

奇怪,php.5.2.14配置后不能连接mysql?
我安装了apache 2.2.16+php5.2.14+mysql 5.1.49。
但是总是连接不上数据库,确认mysql已打开,
apache已成功启动,
loadmodual已成功加载,libmysql.dll已复制到了$WINDOWS\system32下。
但是mysql_connect()却失败
Fatal error: Call to undefined function mysql_connect()....
哪里的问题?

------解决方案--------------------
apache:

Loadfile "PHP安装目录\php5ts.dll"
LoadModule php5_module "PHP安装目录\php5apache2_2.dll"
PHPIniDir "PHP安装目录"
AddHandler application/x-httpd-php .php

php:
extension=php_mysql.dll

php.ini就应该在PHP安装目录下了哈,windows下的没用了。
------解决方案--------------------
lz 看看
php.ini 里面 要去掉
;extension=php_mysql.dll
前面的“;” 去掉

别和
;extension=php_msql.dll
;extension=php_mssql.dll
混掉了

刚看了下 你的 phpinfo
都没有显示 mysql 的 信息

肯定是 mysql模块没有加载 导致的
------解决方案--------------------
配置 环境变量 PHPRC 试试,值是php目录

再不行,换个php版本,,试试?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!