我执行了各种 yum install 命令并安装了所有软件包。
[root@myip php.d]# rpm -qa | grep -i mysql
mysql-server-5.1.69-1.el6_4.x86_64
mysql-libs-5.1.69-1.el6_4.x86_64
perl-DBD-MySQL-4.013-3.el6.x86_64
mysql-devel-5.1.69-1.el6_4.x86_64
mysql-5.1.69-1.el6_4.x86_64
php-mysql-5.3.3-22.el6.x86_64
但在 phpinfo 中我可以看到所有扩展,如 mssql , pgsql , mongo 等,但没有mysql
我应该怎么办
PHP 包
php-common-5.3.3-22.el6.x86_64
php-pdo-5.3.3-22.el6.x86_64
php-pgsql-5.3.3-22.el6.x86_64
php-pecl-imagick-2.2.2-4.el6.x86_64
php-zts-5.3.3-22.el6.x86_64
php-process-5.3.3-22.el6.x86_64
php-ldap-5.3.3-22.el6.x86_64
php-suhosin-0.9.29-2.el6.x86_64
php-enchant-5.3.3-22.el6.x86_64
php-fpm-5.3.3-22.el6.x86_64
php-cli-5.3.3-22.el6.x86_64
php-pear-1.9.4-4.el6.noarch
php-odbc-5.3.3-22.el6.x86_64
php-pecl-memcached-1.0.0-1.el6.x86_64
php-pecl-xdebug-2.1.4-1.el6.x86_64
php-pecl-geoip-1.0.8-3.el6.x86_64
php-pecl-memcache-3.0.5-4.el6.x86_64
php-embedded-5.3.3-22.el6.x86_64
php-soap-5.3.3-22.el6.x86_64
php-snmp-5.3.3-22.el6.x86_64
php-bcmath-5.3.3-22.el6.x86_64
php-mbstring-5.3.3-22.el6.x86_64
php-imap-5.3.3-22.el6.x86_64
php-xmlrpc-5.3.3-22.el6.x86_64
php-gd-5.3.3-22.el6.x86_64
php-xml-5.3.3-22.el6.x86_64
php-recode-5.3.3-22.el6.x86_64
php-5.3.3-22.el6.x86_64
php-mssql-5.3.3-1.el6.x86_64
php-pecl-apc-3.1.9-2.el6.x86_64
php-pecl-mongo-1.4.0-1.el6.x86_64
php-tidy-5.3.3-22.el6.x86_64
php-mcrypt-5.3.3-1.el6.x86_64
php-dba-5.3.3-22.el6.x86_64
php-intl-5.3.3-22.el6.x86_64
php-pspell-5.3.3-22.el6.x86_64
php-php-gettext-1.0.11-3.el6.noarch
php-mysql-5.3.3-22.el6.x86_64
答案1
假设您安装了 php-MySQL,并且假设您正在使用 Apache,您可能只需要重新启动 Apache(如果还没有重新启动)。
我相信 centos,那就是:
$ sudo /etc/init.d/httpd restart