./configure --prefix=$HOME/local/webserver/php --with-config-file-path=$HOME/local/webserver/php/etc --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl-dir=/usr/bin/openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap
configure: error: Cannot find MySQL header files under /usr/share/mysql.
Note that the MySQL client library is not bundled anymore!
====== 解決辦法 ======
卸载mysql-server mysql-client
重装mysql-server mysql-clinet
sudo apt-get remove mysql-server mysql-client
sudo apt-get remove mysql-server-5.1 mysql-client-5.1
sudo apt-get installl mysql-server-5.1 mysql-client-5.1
安装完后,mysql正常工作,但配置php,仍然出错。
是不是包又安装错了?
说我少了mysql头文件,于是寻找whereis mysql
找到几个目录
mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
sudo find / -name mysql.h
但没找到这个文件。不知道是哪出了问题。
又一个测试失败,继续。。。
######又来找其它办法来了######
安装一个mysql 的lib文件,命令如下:
sudo apt-get install libmysqlclient16 libmysqlclient16-dev
然后再./configure --prefix=/usr/local/php5.3.3 --enable-fpm --with-mysql=/usr/share/mysql --with-mysqli --with-openssl OK 这次终于通过。然后就是 make&&make install