PHP常见报错

1.很多人认为错误提示是说apxs不存在,其实真正的原因是apxs无法运行。
刚刚测试了一下,在没装perl的情况下编译安装apache生成的apxs的第一行是:#!/replace/with/path/to/perl/interpreter -w 。使用apxs需要安装perl,因为apxs使用的perl脚本。
接下来装perl
yum install perl
安装好后,必须修改apxs文件,因为他的第一行还是#!/replace/with/path/to/perl/interpreter -w ,#!/replace/with/path/to/perl/interpreter这个文件是不存在的,当然不能运行。
装第一行修改成#!/usr/bin/perl -w,保存就行了。
建议还是先安装perl再编译安装apache,这样方便些,不会太麻烦

2.configure: error: Please reinstall the BZip2 distribution
确认安装了 bzip2 和 bzip2-devl, 如果 没有安装之:
yum -y install bzip2 bzip2-devel

3.configure: error: xml2-config not found. Please check your libxml2 installation.
yum -y install libxml2-devel

4.configure: error: Cannot find OpenSSL’s <evp.h>
yum -y install openssl openssl-devel

6.configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
yum -y install libcurl libcurl-devel

7.If configure fails try –with-vpx-dir=<DIR>
configure: error: jpeglib.h not found.
yum -y install libvpx libvpx-devel libjpeg-devel

8.configure: error: freetype-config not found.
yum -y install freetype-devel

9.configure: error: Cannot find ldap.h
yum -y install openldap openldap-devel

10.configure: error: Cannot find ldap libraries in /usr/lib.
cp -frp /usr/lib64/libldap* /usr/lib/

11.configure: error: Please reinstall readline - I cannot find readline.h
yum -y install readline-devel

12.configure: error: png.h not found.
yum -y install libpng-devel

13.cc1: out of memory allocating 80588 bytes after a total of 16736256 bytes
make: * [ext/date/lib/parse_date.lo] 错误 1
如果内存小于1G,需要加上–disable-fileinfo

make: * [ext/fileinfo/libmagic/apprentice.lo] Error 1
解决办法
这是由于内存小于1G所导致.
在./configure加上选项:–disable-fileinfo
Disable fileinfo support 禁用 fileinfo

/lib64/liblber-2.4.so.2: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: * [sapi/cli/php] Error 1
1)./configure后
2)编辑MakeFile
3)找到 开头是 ‘EXTRA_LIBS’ 这一行 在结尾加上 ‘-llber’ 然后执行 make && make install

yum -y install bzip2 bzip2-devel libxml2-devel openssl openssl-devel libcurl libcurl-devel libvpx libvpx-devel libjpeg-devel freetype-devel openldap openldap-devel readline-devel libpng-devel

cp -frp /usr/lib64/libldap /usr/lib/
cp -frp /usr/lib64/libpng
/usr/lib/
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
cp -frp /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so
 

-------------本文结束感谢您的阅读-------------