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/,如需轉載,請注明出處,否則將追究法律責任。
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的php baocuo error,PHP编译报错configure: error: Cannot find libmysqlclient under /usr.的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 英伟达发布 RTX 5000/4500/
- 下一篇: 美电信巨头Verizon关闭视频会议应用