PHP 5.4.9 Mysqli的问题

在Ubuntu 12.04服务器上,我从源代码安装了PHP 5.4.9:

./configure –prefix = / etc / php –with-apxs2 = / etc / apache2 / bin / apxs –with-config-file-path = / etc / php –with-config-file-scan-dir = / etc / php / conf.d –with-libxml-dir = / usr / local / libxml2 –with-xsl = / usr / local / libxslt –with-mysql –with-zlib –with-pdo -mysql –enable-calendar –with-gd –with-iconv-dir –enable-mbstring –enable-soap –enable-sockets –enable-zip –with-curl –with-openssl – -with-kerberos –with-tidy'

然后,使用apt-get,我安装了mysql服务器和phpMyAdmin。 不幸的是,phpMyAdmin一直在说'mysqli'和'mcrypt'没有安装。 php -m | grep mysqli只是证实了它。

所以我试着用“apt-get install php5-mysqli”来安装mysqli,但只是通过“php5-mysqlnd”或“php5-mysql”的方式得到了消息。 即使他们已经安装(根据phpinfo())我试过 – 不起作用。 但是,在php.ini中,有mysqli的工作人员,如“extension = php_mysqli.dll”,但没有“extension = mysqli.so”。 并阻止[MySQLi]与一些未注释的设置也存在。

由于这是我第一次尝试从源代码构buildPHP,我认为我做了一些愚蠢的错误。 任何帮助是极大的赞赏。

UPD:问题已解决1.启用mcrypt扩展( http://sourceforge.net/projects/mcrypt/files/)1.1下载,解包,configuration,编译和安装Libmcrypt

wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz tar xf libmcrypt-2.5.8.tar.gz cd libmcrypt-2.5.8 ./configure make && make install

1.2下载,解包,configuration(我加了可取的path:—- prefix = / usr / local / mcrypt),编译并安装mcrypt

wget http://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz tar xf lmcrypt-2.6.8.tar.gz cd lmcrypt-2.6.8 ./configure –prefix = / usr / local / mcrypt make && make install

2.安装mysqli我跟着提出的configurationphp的选项取自http://php.net/manual/en/mysqli.installation.php

./configure –with-mysql = / usr / bin / mysql_config \ –with-mysqli = mysqlnd \ –with-pdo-mysql = mysqlnd [其他选项]

所以在安装Libmcrypt之后,mcrypt在/ usr / local / mcrypt中添加了对phpconfiguration的修改,终于成功了。 最终的configuration看起来是这样的:

./configure --prefix=/etc/php --with-apxs2=/etc/apache2/bin/apxs --with-config-file-path=/etc/php --with-config-file-scan-dir=/etc/php/conf.d --with-libxml-dir=/usr/local/libxml2 --with-xsl=/usr/local/libxslt --with-mysql --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mcrypt=/usr/local/mcrypt --with-zlib --enable-calendar --with-gd --with-iconv-dir --enable-mbstring --enable-soap --enable-sockets --enable-zip --with-curl --with-openssl --with-kerberos --with-tidy --with-pcre-regex 

PS:请注意,要运行这个,你需要下载,configuration,编译和安装libxml,libxslt,prce,mcrypt,Libmcrypt

如果你需要支持mcrypt和mysql的PHP,那么–with-mcrypt –with-mysqli选项在哪里?