php编译时出现的几个问题

编译参数

‘./configure’  ‘–prefix=/usr/local/php.5.3.10′

‘–enable-fpm’

‘–with-openssl’

‘–with-pcre-regex’

‘–with-zlib’

‘–with-bz2′

‘–with-curl’

‘–with-gd’

‘–with-gettext’

‘–enable-mbstring’

‘–with-mcrypt’

‘–with-mysql=/usr/local/mysql’

‘–with-pdo-mysql’

‘–enable-zip’

‘–with-pear’

‘–with-libdir=lib64′

‘–enable-exif’

‘–enable-sockets’

‘–enable-ftp’

‘–with-gmp’

‘–with-mhash’

‘–with-mysqli=/usr/local/mysql/bin/mysql_config’

‘–enable-pcntl’

‘–with-snmp’

‘–enable-soap’

‘–enable-sysvmsg’

‘–with-tidy’

‘–enable-wddx’

‘–with-kerberos’

‘–with-jpeg-dir’

‘–with-png-dir’

‘–with-freetype-dir’

‘–with-readline’

–enable-bcmath

–with-mysql-sock=/tmp/mysql.sock

1. configure: error: Cannot find libmysqlclient under /usr/local/mysql

原因是因为我编译是64位系统。而mysql二进制分发包里是lib。。

解决方法:

ln -s /usr/local/mysql/lib /usr/local/mysql/lib64

2. checking for mysql_config… not found

ln -s /usr/local/mysql/bin/mysql_config /usr/bin/mysql_config

3. /usr/bin/ld: cannot find -lltdl

wget http://mirrors.ustc.edu.cn/gnu/libtool/libtool-2.4.tar.gz

make

make install