標籤:linux
PHP開源指令碼語言
PHP(外文名: Hypertext Preprocessor,中文名:“超文本前置處理器”)是一種通用開源指令碼語言。文法吸收了C語言、Java和Perl的特點,入門門檻較低,易於學習,使用廣泛,主要適用於Web開發領域。PHP的檔案尾碼名為php。
本文為大家整理匯總了一些linux下編譯安裝php各種報錯大集合 ,感興趣的同學參考下。
報錯1:make 後報錯如下:
Generating phar.php/home/oldboy/tools/php-5.3.27/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directorymake: *** [ext/phar/phar.php] 錯誤 127
解決方案:
[[email protected] php-5.3.27]# ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64/[[email protected] php-5.3.27]# makeGenerating phar.pharchmod: 無法訪問"ext/phar/phar.phar": 沒有那個檔案或目錄make: [ext/phar/phar.phar] 錯誤 1 (忽略)Build complete.Don‘t forget to run ‘make test‘.
make後還是報錯:
[[email protected] php-5.3.27]# cd ext/phar/[[email protected] phar]# cp ./phar.php ./phar.phar[[email protected] php-5.3.27]# pwd/home/oldboy/tools/php-5.3.27[[email protected] php-5.3.27]# makeBuild complete.Don‘t forget to run ‘make test‘.
終於不報錯了。
nginx1.6.2-mysql5.5.32二進位,php安裝報錯解決:
[[email protected] php-5.3.27]#make
...
...
Generating phar.php
/home/oldboy/tools/php-5.3.27/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
make: *** [ext/phar/phar.php] 錯誤 127
報錯:
解決1:
[[email protected] php-5.3.27]# find / -name "libmysqlclient.so.18"
/home/oldboy/tools/mysql-5.5.32-linux2.6-x86_64/lib/libmysqlclient.so.18
/application/mysql-5.5.32/lib/libmysqlclient.so.18
[[email protected] php-5.3.27]# echo "/usr/local/lib" >>/etc/ld.so.conf
[[email protected] php-5.3.27]# echo "/application/mysql-5.5.32/lib" >>/etc/ld.so.conf
[[email protected] php-5.3.27]# tail -1 /etc/ld.so.conf
/application/mysql-5.5.32/lib
[[email protected] php-5.3.27]# ldconfig
[[email protected] php-5.3.27]# make
Generating phar.phar
chmod: 無法訪問"ext/phar/phar.phar": 沒有那個檔案或目錄
make: [ext/phar/phar.phar] 錯誤 1 (忽略)
Build complete.
Don‘t forget to run ‘make test‘.
解決:mkdir ext/phar/phar.phar -p
問題:make報錯
/home/oldboy/tools/php-5.3.27/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
make: *** [ext/phar/phar.php] 錯誤 127
解決辦法:
ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64/
報錯:
/home/oldboy/tools/php-5.3.27/ext/xmlrpc/libxmlrpc/encodings.c:81: undefined reference to `libiconv‘
/home/oldboy/tools/php-5.3.27/ext/xmlrpc/libxmlrpc/encodings.c:101: undefined reference to `libiconv_close‘
collect2: ld returned 1 exit status
make: *** [sapi/fpm/php-fpm] Error 1
解決辦法:
make ZEND_EXTRA_LIBS=‘-liconv‘
精典錯誤
/libxmlrpc/encoding.c:101:undefined reference to ‘libiconv_close‘
collect2: ld returned 1 exit status
make:*** [sapi/fpm/php-fpm] Error 1
解決方案:
#make ZEND_EXTRA_LIBS=‘-liconv‘
錯誤一、編譯php出錯
/php-5.3.2/ext/fileinfo/libmagic/apprentice.c:147:internal compiler error:Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.
The bug is not reproducible,so it is likely a hardware or OS problem.
make:*** [ext/fileinfo/libmagic/apprentice.lo] Error 1
解決方案:記憶體大於1G即可,這是php5.3.2的一個bug
錯誤二、重新構造configure檔案出錯
./buildconf --force
Forcing buildconf
buildconf:checking installation...
buildconf:autoconf version 2.59 (ok)
buildconf:Your version of autoconf likely contains buggy cache code.
Running vcsclean for you.
To avoid this,install autoconf-2.13.
Can‘t figure out your VCS, not cleaning.
解決方案:編譯安裝autoconf-2.13
再將autoconf-2.13的auotconf檔案至/usr/local/autoconf
--------------------------------------------------------------------
錯誤三、編譯時間缺少庫
configure: error: libXpm.(a|so) not found.
解決方案:yum install libXpm-devel
--------------------------------------------------------------------
錯誤四、編譯時間缺少gmp.h檔案
configure: error: Unable to locate gmp.h
解決方案:yum install gmp-devel
--------------------------------------------------------------------
錯誤五
Configure: error: xml2-config not found. Please check your libxml2 installation.
解決方案:
#yum install libxml2 libxml2-devel (For Redhat & Fedora)
# aptitude install libxml2-dev (For ubuntu)
--------------------------------------------------------------------
錯誤六
Checking for pkg-config… /usr/bin/pkg-config
configure: error: Cannot find OpenSSL’s <evp.h>
解決方案:
#yum install openssl openssl-devel
--------------------------------------------------------------------
錯誤七
Configure: error: Please reinstall the BZip2 distribution
解決方案:
# yum install bzip2 bzip2-devel
--------------------------------------------------------------------
錯誤八
Configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
解決方案:
# yum install curl curl-devel (For Redhat & Fedora)
# install libcurl4-gnutls-dev (For Ubuntu)
--------------------------------------------------------------------
錯誤九:
Configure: error: libjpeg.(also) not found.
解決方案:
# yum install libjpeg libjpeg-devel
--------------------------------------------------------------------
錯誤十
Configure: error: libpng.(also) not found.
--------------------------------------------------------------------
解決方案:
# yum install libpng libpng-devel
--------------------------------------------------------------------
錯誤十一
Configure: error: freetype.h not found.
解決方案:
#yum install freetype-devel
--------------------------------------------------------------------
錯誤十二
Configure: error: Unable to locate gmp.h
解決方案:
# yum install gmp-devel
--------------------------------------------------------------------
錯誤十三
Configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
解決方案:
# yum install mysql-devel (For Redhat & Fedora)
# apt-get install libmysql++-dev (For Ubuntu)
--------------------------------------------------------------------
錯誤十四
Configure: error: Please reinstall the ncurses distribution
解決方案:
# yum install ncurses ncurses-devel
--------------------------------------------------------------------
錯誤十五
Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
解決方案:
# yum install unixODBC-devel
--------------------------------------------------------------------
錯誤十六
Configure: error: Cannot find pspell
解決方案:
# yum install pspell-devel
--------------------------------------------------------------------
錯誤十七
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解決方案:
# yum install libmcrypt libmcrypt-devel (For Redhat & Fedora)
# apt-get install libmcrypt-dev
--------------------------------------------------------------------
錯誤十八
Configure: error: snmp.h not found. Check your SNMP installation.
解決方案:
# yum install net-snmp net-snmp-devel
--------------------------------------------------------------------
錯誤十九
configure:error:Cannot find ldap.h
解決方案:
#yum install openldap-devel openldap
錯誤二十
configure:error:xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
解決方案:
#yum install libxslt libxslt-devel
錯誤二十一
checking for libevent >=1.4.11 install prefix... configure: error: Could not find libevent >=1.4.11 in /usr/local/php
解決方案:
安裝libevent-1.4.11以上版本至/usr/local
tar xzvf libevent-1.4.14-stable.tar.gz
cd libevent-1.4.14-stable
./configure --prefix=/usr/local
make&&make install
在編譯./configure時添加--with-libevent-dir=/usr/local即可
錯誤二十二
cc1: out of memory allocating 2036 bytes after a total of 81846272 bytes
make: *** [ext/date/lib/parse_date.lo] Error 1
報錯:
/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make:*** [sapi/fpm/php-fpm] Error 1
解決方案:
安裝ltdl
#cd ../libmcrypt-2.5.7/libltdl/
#./configure --enable-ltdl-install
#ldconfig
#cd php-5.3.6
#make ZEND_EXTRA_LIBS=‘-liconv‘
done s
錯誤23:
有時候我們編譯php的時候會出現以下錯誤:make ***[libphp5.la] Error 1處理方法:安裝兩個rpm包#yum -y install libtool.i386 libtool-ltdl-devel.i386clean下 #make clean #make
650) this.width=650;" title="13.jpg" src="https://s5.51cto.com/wyfs02/M00/A4/74/wKioL1mryzbAtTAlAAB0Ab-Z9bY247.jpg" alt="wKioL1mryzbAtTAlAAB0Ab-Z9bY247.jpg" />
http://www.phperz.com/article/14/1207/39774.html
本文出自 “sandshell” 部落格,請務必保留此出處http://sandshell.blog.51cto.com/9055959/1962327
linux下編譯安裝php各種報錯大集合