本帖最后由 kevinjin 于 2016-8-28 15:26 编辑
LAMP环境:x86_64, mysql 5.7.13, php 5.4.37, httpd-2.4.20
问题:
mysql初始化完成以及apache安装完成后,配置php的编译参数时会产生这样的错误信息:
configure: error: Cannot find libmysqlclient_r under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!
解决方法:
在编译的时候,不写mysql的路径,而使用mysqlnd代替
./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/php/etc \
--with-mysql=mysqlnd \
--with-libxml-dir \
--with-libdir=lib \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir \
--with-zlib-dir \
--with-bz2 \
--with-openssl \
--with-mcrypt \
--enable-soap \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-sockets \
--enable-exif \
--disable-ipv6
奇怪的是在LNMP的情况下指定--with-mysql=/usr/local/mysql, 配置过程中就一点问题也没有
LAMP环境:x86_64, mysql 5.7.13, php 5.4.37, httpd-2.4.20
问题:
mysql初始化完成以及apache安装完成后,配置php的编译参数时会产生这样的错误信息:
configure: error: Cannot find libmysqlclient_r under /usr/local/mysql.
Note that the MySQL client library is not bundled anymore!
解决方法:
在编译的时候,不写mysql的路径,而使用mysqlnd代替
./configure \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/php/etc \
--with-mysql=mysqlnd \
--with-libxml-dir \
--with-libdir=lib \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir \
--with-zlib-dir \
--with-bz2 \
--with-openssl \
--with-mcrypt \
--enable-soap \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-sockets \
--enable-exif \
--disable-ipv6
奇怪的是在LNMP的情况下指定--with-mysql=/usr/local/mysql, 配置过程中就一点问题也没有
编辑回复