开发者

Configure PHP and mysql connection under linux

I encounter this problem when configure PHP and mysql on my linux box (Fedora开发者_如何学Python 14).

The problem is when I invoke mysqli_connect(), an error issues:

Call to undefined function mysqli_connect().

while call to mysql_connect() works fine.

I install PHP and mysql manually and also turn on the flag --with-mysql when installing PHP. Can't figure out where things go wrong.


Mysql-i is not Mysql, these are 2 distinct PHP modules and MySQL APIs. Have a look at PHP's documentation regarding the mysqli installation.


If yum is an option for you, you can simply run the following to install the mysqli extenstion:

yum install php-mysqli

EDIT: Marc B informs that mysqli is included in the core php rpm on Fedora 14. Simply install php via yum (after removing your manual install) with yum install php


http://php.net/manual/en/mysqli.installation.php says:

To use MySQL Native Driver with mysqli you need to configure the PHP source code using the --with-mysqli=mysqlnd option, prior to building PHP.

In other words, --with-mysql is for a different module (which, as you note, works fine).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜