安装php configure无法通过:报错Note that the MySQL client library is not bundled anymore!

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装php configure无法通过:报错Note that the MySQL client library is not bundled anymore!相关的知识,希望对你有一定的参考价值。

大家好,我在centos 6上安装php 5.4.14。通过yum安装了mysql。手动安装了nginx
现在手动安装php 5.4.14。报错!请大家看看是不是我通过yum安装mysql有问题?
另外请大家看看这个写的对不对
./configure --prefix=/usr/local/php-fcgi --with-mysql=/usr/local/mysql ---with-mhash --enable-fpm --enable-fastcgi

报错命令
checking for specified location of the MySQL UNIX socket... no
configure: error: Cannot find MySQL header files under /usr/bin/mysql.
Note that the MySQL client library is not bundled anymore!

mysql安装地址
[root@localhost php-5.4.14]# whereis mysql
mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

我应该如何修补这个问题?请大家小白一些的帮帮我。入门新手。谢谢!

看你的问题应该是php编译的时候有问题吧 支持mysql的时候。 如果你不知道你的mysql库在哪里,你可以mysqlnd试试呢 php5.4貌似是支持的 我记得、

./configure --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd 你的参数
参考技术A 如果不知道 header file 在哪,用 「find / -name mysql.h」命令找出其位置;   
如果是自己也有手动安装 MySQL 套件的话,直接指定该位置。
在 ./configure 下参数指定 header file 的位置(即mysql安装目录),如下:
./configure --with-apxs2=/usr/local/Apache2/bin/apxs
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config

如果依然提示找不到mysql_config提示:
checking for mysql_config... /usr/bin/mysql_config is not a directoryconfigure: error: can not find mysql under the /usr/bin/mysql_config that you specified
则cp /usr/local/mysql/bin/mysql_config /usr/bin/mysql_config

php.config.sh的编译参数如下:
#! /bin/sh
ulimit -HSn 65536
CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"; CXXFLAGS="$CFLAGS" ;export CFLAGS CXXFLAGS
#LDFLAGS="-L/usr/lib64 -L/lib64"; export LDFLAGS
./configure --enable-inline-optimization --disable-debug
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-apxs2=/usr/local/apache2/bin/apxs --with-iconv --with-curl
--enable-mbstring --enable-sockets --with-png-dir
--with-jpeg-dir=/usr/local/jpeg6/lib --with-freetype-dir --with-gd
--with-libxml-dir=/usr --enable-xml --enable-zip --with-zlib-dir
--with-gettext --enable-pdo --with-pdo-sqlite
--with-pdo-mysql=/usr/bin/mysql_config --enable-calendar --enable-ftp
--with-pcre-regex --disable-ipv6 --enable-soap

PHP编译安装报错:configure: error: mcrypt.h not found. Please reinstall libmcrypt

我是在CentOS6.5安装php5.5.28这个版本,PHP编译代码如下:

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-gd --with-iconv --with-zlib --with-fpm-user=php --with-fpm-group=php --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-pear --with-gettext --enable-session  --with-curl --enable-exif

 

安装过程不再赘述。因为在编译安装时没有把mcrypt这个扩展编译进去,所以在phpmyadmin里有这样一句提示:

缺少 mcrypt 扩展。请检查 PHP 配置。

另外在独立安装mycrypt扩展时,报错:

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

 

现在把mcrypt扩展安装过程贴出来,希望对遇到此类问题的朋友有帮助:

 

1.首先编译安装  libmcrypt,  mhash,  mcrypt  二进制源码包。

 

========================================

下载libmcrypt-2.5.8.tar.gz

tar zxvf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure --prefix=/usr/local/libmcrypt

make 

make install

 

=========================================

下载mhash-0.9.9.9.tar.gz

tar zxvf mhash-0.9.9.9

cd mhash-0.9.9.9

./configrue --prefix=/usr/local/mhash

make

make install

 

=========================================

tar zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8

export LD_LIBRARY_PATH=/usr/local/libmcrypt/lib:/usr/local/mhash/lib

export LDFLAGS="-L/usr/local/mhash/lib -I/usr/local/mhash/include/"

export CFLAGS="-I/usr/local/mhash/include/"

./configure --prefix=/usr/local/mcrypt --with-libmcrypt-prefix=/usr/local/libmcrypt

make

make install

=========================================

 

cd /usr/local/src/develop/php-5.5.28/ext/mcrypt

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config  --with-mcrypt=/usr/local/libmcrypt

make

make install

生成的mcrypt.so文件已经被发送到 /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so

因为我在php.ini设置extension_dir = /usr/local/php/extensions,

所以需要执行:

cp /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so  /usr/local/php/extensions

然后在php.ini里面添加:
extension=mcrypt.so
重启php,执行: service php-fpm restart
运行phpinfo(),发现新增了mcrypt扩展项,而且phpmyadmin里面关于mcrypt的提示也不见了。
 
 
在安装过程中走了弯路,一度鄙视这种编译安装方式,多亏了这位大神发的帖子帮忙。
详见: http://segmentfault.com/q/1010000000094627

 

==============================================================

64位Centos报错:
configure: error: Cannot find ldap libraries in /usr/lib.
解决方法是执行命令: cp -frp /usr/lib64/libldap* /usr/lib/

以上是关于安装php configure无法通过:报错Note that the MySQL client library is not bundled anymore!的主要内容,如果未能解决你的问题,请参考以下文章

解决php编译报错configure: error: mcrypt.h not found. Please reinstall libmcrypt.

解决php编译报错configure: error: mcrypt.h not found. Please reinstall libmcrypt.

安装php时,configure: error: xml2-config not found. Please check your libxml2 installation

centos7 安装nginx和php5.6.25遇到 无法访问php页面 报错file not found 问题解决

PhP 常见安装错误configure error xml2-config not found. please check your libxml2 installation

Nginx部署.nginx报错:./configure: error: C compiler cc is not found, gcc 是已经安装了的