Home > Database > Mysql Tutorial > 解决办法:mysql_connect()不支持请检查mysql模块是否正确加载_MySQL

解决办法:mysql_connect()不支持请检查mysql模块是否正确加载_MySQL

WBOY
Release: 2016-06-01 13:01:36
Original
1880 people have browsed it

  故障现象:linux 安装discuz 错误提示:mysql_connect() 不支持请检查mysql模块是否正确加载.

  解决办法:查看/usr/lib/php/modules/ (64位的看/usr/lib64/php/modules/)里面根本没有mysql.so

  找到centos5.4安装盘,放入光驱,然后找到CentOS目录下的

  php-mysql-5.1.6-20.el5.i386.rpm

  php-pdo-5.1.6-20.el5.i386.rpm

  二个文件,然后通过FTP上传到服务器。

  执行安装:

  rpm -i php-mysql-5.1.6-20.el5.i386.rpm --nodeps

  pm -i php-pdo-5.1.6-20.el5.i386.rpm --nodeps

  再查看so文件:

  ls /usr/lib/php/modules/

  dbase.so ldap.so mysqli.so mysql.so pdo_mysql.so pdo.so pdo_sqlite.so phpcups.so

  mysql.so存在了。

  然后配置

  vi /etc/php.ini找到extension=msql.so,然后在它下方去掉前面分号然后添加如下:

  extension=mysql.so

  extension=mysqli.so

  extension=pdo_MySQL.so

  保存,重启httpd

  /etc/init.d/httpd restart

  刷新网页,mysql已经能连上了。

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