编译PHP7与MySQL错误

我正在CentOS 6.7上为PHP7设置一个alt-install,其中包含原始PHP版本的configuration选项:

./configure --disable-fileinfo --disable-opcache --disable-posix --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-mbstring --enable-pdo=shared --enable-soap --enable-sockets --enable-zip --prefix=/usr/local/php7 --with-bz2 --with-curl=/opt/curlssl/ --with-freetype-dir=/usr --with-gd --with-gettext --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libdir=lib64 --with-libxml-dir=/opt/xml2 --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-openssl=/usr --with-openssl-dir=/usr --with-pcre-regex=/opt/pcre --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=/usr --with-tidy=/opt/tidy/ --with-xpm-dir=/usr --with-zlib --with-zlib-dir=/usr 

它抛出了以下错误:

 configure: WARNING: unrecognized options: --with-mysql 

有谁知道什么是正确的选项是PHP7,我似乎无法在Google上find它? 谢谢 :)

PHP7中不再支持–with-mysql选项。 你需要为此使用mysqli扩展。

我没有testing过这个,但是当你执行./configure时默认会安装mysqli扩展,默认情况下不启用,所以你需要在安装之后启用它。

更改参数

--with-mysql这个值--with-mysqli