源码安装php提示Cannot find libmysqlclient under /usr/local/mysql

    环境介绍:

    Centos 5.7,源码安装了MySQL,Nginx;

    使用源码编译安装php5.5.23,步骤如下:

    shell>./configure --prefix=/usr/local/php-5.5.23 --with-config-file-path=/usr/local/php-5.5.23/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-mysql=/usr/local/mysql --enable-mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir

    提示错误如下:Cannot find libmysqlclient under /usr/local/mysql

    在/usr/loca/mysql/lib/下确实有需要libmysqlclient文件,故手动修改--with-mysql=/usr/local/mysql/lib

    在此执行,又提示错误Cannot find MySQL header files under /usr/local/mysql/lib/

    无奈之下,直接不写路径了

    shell>./configure --prefix=/usr/local/php-5.5.23 --with-config-file-path=/usr/local/php-5.5.23/etc --with-bz2 --with-curl --enable-ftp --enable-sockets --disable-ipv6 --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-iconv-dir=/usr/local --enable-mbstring --enable-calendar --with-gettext --with-libxml-dir=/usr/local --with-zlib --with-mysql --enable-mysqlnd --enable-dom --enable-xml --enable-fpm --with-libdir

    编译成功了

    

你可能感兴趣的:(mysql,nginx,PHP,源码安装)