问题描述
我在CentOS 5.6上从命令行运行一个简单的测试脚本,其中的PHP包已从 时,PHP运行良好。
mysql_connect()它失败,没有错误。如果我执行
$ php -m
我没有看到MySQL作为已安装的模块。
但是我已经将 extension = mysql.so
添加到我的php.ini并重新启动。
'rpm -qa | grep php'
php-common-5.3.10-1.w5
php-5.3。 10-1.w5
php-cli-5.3.10-1.w5
yum install php-mysql的输出
- >缺少依赖关系:php-mysql-5.1.6-27.el5_7.5.x86_64(更新)需要php-common = 5.1.6-27.el5_7.5
php-pdo-5.1.6- 27.el5_7.5.x86_64从更新已解决问题
- >缺少依赖关系:php-common = 5.1.6-27.el5_7.5是包需要php-pdo-5.1.6-27.el5_7.5.x86_64(更新)
错误:缺少依赖关系:php-common = 5.1.6-27.el5_7.5是包需要php-pdo-5.1.6-27.el5_7.5.x86_64(更新)
错误:缺少依赖关系:php-common = 5.1.6-27 .el5_7.5是需要的包php-mysql-5.1.6-27.el5_7.5.x86_64(更新)
你可以尝试使用--skip-broken来解决问题
你可以尝试运行:package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
程序包清理在yum-utils包中。
没有看到MySQL作为一个已安装的模块。
您是否安装了它?
#yum install php-mysql
php
from)。
编辑:
this:
yum --enablerepo = webtatic install php-mysql
这告诉yum从webtatic存储库(除了系统配置的存储库)获取软件包。如果您希望在启用系统的存储库中使用webtatic,请运行:
yum --enablerepo = webtatic install webtatic-release
I am running a simple test script from the command line on CentOS 5.6 with the PHP package installed from PHP 5.3 on CentOS/RHEL 5.6.
PHP runs fine in all other cases but when I hit
mysql_connect()
it fails without error.If I run
$ php -m
I am not seeing MySQL as an installed module.
However I have added
extension=mysql.so
to my php.ini and rebooted.Output of 'rpm -qa | grep php'
php-common-5.3.10-1.w5 php-5.3.10-1.w5 php-cli-5.3.10-1.w5
Output of 'yum install php-mysql'
--> Missing Dependency: php-common = 5.1.6-27.el5_7.5 is needed by package php-mysql-5.1.6-27.el5_7.5.x86_64 (updates) php-pdo-5.1.6-27.el5_7.5.x86_64 from updates has depsolving problems --> Missing Dependency: php-common = 5.1.6-27.el5_7.5 is needed by package php-pdo-5.1.6-27.el5_7.5.x86_64 (updates) Error: Missing Dependency: php-common = 5.1.6-27.el5_7.5 is needed by package php-pdo-5.1.6-27.el5_7.5.x86_64 (updates) Error: Missing Dependency: php-common = 5.1.6-27.el5_7.5 is needed by package php-mysql-5.1.6-27.el5_7.5.x86_64 (updates) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest The program package-cleanup is found in the yum-utils package.
解决方案I am not seeing MySQL as an installed module.
Did you install it?
# yum install php-mysql
(from the same repo you installed
php
from).EDIT:
run this:
yum --enablerepo=webtatic install php-mysql
this tells yum to get the packages from webtatic repository (in addition to system configured repositories). If you want webtatic among system enabled repositories, run:
yum --enablerepo=webtatic install webtatic-release
这篇关于php:mysql_connect()失败,没有错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!