无法将PHP查询发送到MySQL

无法将PHP查询发送到MySQL,php,mysql,Php,Mysql,当我试图将查询从PHP 5.4.6 TS、VC9发送到MySQL 5.5 NTS、VC9时,我得到以下消息: Fatal error: Call to undefined function mysql_connect() 在Windows xp上重新启动Apache 2.2后,会显示: PHP Startup: mysql: Unable to initialize module Module compiled with build ID=API20100525,NTS,VC9 PHP

当我试图将查询从PHP 5.4.6 TS、VC9发送到MySQL 5.5 NTS、VC9时,我得到以下消息:

 Fatal error: Call to undefined function mysql_connect()
在Windows xp上重新启动Apache 2.2后,会显示:

PHP Startup: mysql: Unable to initialize module
Module  compiled with build ID=API20100525,NTS,VC9
PHP     compiled with build ID=API20100525,TS,VC9
These options needs to match

如何解决这个问题?

您可能安装了PHP5.4,但没有mysql支持包。在Linux的一些发行版中,PHP mysql扩展位于单独的包中

例如,在我的CentOS VM上安装了以下软件包:

$ rpm -qa | grep php
php55w-common-5.5.0-1.w6.x86_64
php55w-pear-1.9.4-6.w6.noarch
php55w-cli-5.5.0-1.w6.x86_64
php55w-mysql55-5.5.0-1.w6.x86_64
php55w-5.5.0-1.w6.x86_64
php55w-pdo-5.5.0-1.w6.x86_64
至于如何解决这个错误,这取决于您使用的Linux发行版,以及安装PHP的包repo是什么


PS:除非您需要支持旧式PHP代码,否则您根本不应该使用不推荐的mysql_*扩展。使用或。

您可能安装的PHP5.4没有mysql支持包。在Linux的一些发行版中,PHP mysql扩展位于单独的包中

例如,在我的CentOS VM上安装了以下软件包:

$ rpm -qa | grep php
php55w-common-5.5.0-1.w6.x86_64
php55w-pear-1.9.4-6.w6.noarch
php55w-cli-5.5.0-1.w6.x86_64
php55w-mysql55-5.5.0-1.w6.x86_64
php55w-5.5.0-1.w6.x86_64
php55w-pdo-5.5.0-1.w6.x86_64
至于如何解决这个错误,这取决于您使用的Linux发行版,以及安装PHP的包repo是什么

PS:除非您需要支持旧式PHP代码,否则您根本不应该使用不推荐的mysql_*扩展。使用或