php baocuo error,PHP编译报错configure: error: Cannot find libmysqlclient under /usr.

今天编译PHP的时候遇到了几个错误,记录一下

第一次编译的时候报错如下:

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

报这个错是因为没有安装libmcrypt这个包,下载地址如下:

wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz

安装:

[root@localhost app]# tar zxfv libmcrypt-2.5.7.tar.gz

[root@localhost app]# cd libmcrypt-2.5.7

[root@localhost app]# ./configure

[root@localhost app]# make ; make install

重新编译php

[root@localhost app]# cd php-5.3.28

[root@localhost php-5.3.28]# ./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config --with-mysql-sock=/var/lib/mysql/mysql.sock --with-gd --with-iconv  --with-zlib  --enable-xml --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbregex  --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl

第二次编译报错如下:

configure: error: Cannot find libmysqlclient under /usr.

Note that the MySQL client library is not bundled anymore!

这个错误时因为在64位的linux系统中,libmysqlclient 默认安装到了 /usr/lib64/mysql/ 目录下,但是php编译时,要去/usr/lib目录下查找

解决办法:在/usr/lib目录下创建一个软连接

[root@localhost php-5.3.28]# ls /usr/lib64/mysql/libmysqlclient*

/usr/lib64/mysql/libmysqlclient_r.so     /usr/lib64/mysql/libmysqlclient_r.so.16.0.0  /usr/lib64/mysql/libmysqlclient.so.16

/usr/lib64/mysql/libmysqlclient_r.so.16  /usr/lib64/mysql/libmysqlclient.so           /usr/lib64/mysql/libmysqlclient.so.16.0.0

[root@localhost php-5.3.28]# ln -s /usr/lib64/mysql/libmysqlclient.so.16 /usr/lib/libmysqlclient.so

最后编译成功:

+--------------------------------------------------------------------+

| License:                                                           |

| This software is subject to the PHP License, available in this     |

| distribution in the file LICENSE.  By continuing this installation |

| process, you are bound by the terms of this license agreement.     |

| If you do not agree with the terms of this license, you must abort |

| the installation process at this point.                            |

+--------------------------------------------------------------------+

Thank you for using PHP.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23249684/viewspace-1242858/,如需转载,请注明出处,否则将追究法律责任。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值