本文目录一览:
- 1、./configure编译php时这个问题如何解决?
- 2、我发现我在操作PHP的时候,在Linux下安装PHP过程中,编译时出现configure: err
- 3、编译安装php时出错configure: error: build test failed.
- 4、哪些是编译php时的常用configure参数
- 5、安装php时显示configure error jpeglib.h not found该怎么解决?
./configure编译php时这个问题如何解决?
PHP的安装虽然有时候很简单,可是如果应用一多,我们安装起来就很头痛了!出错最多的就是安装PHP扩展的时候了。其实不管是你是Apache类的应用还是Nginx类的,PHP的安装都不是很简单,虽然网上有很多configure参数,但是那不一定是适合你的,因为很多都直接关系着你的系统版本和内核。因此要自己亲自不断的调试,才能完全安装成功。
本文总结了一些常见的configure错误信息和解决这些错误的经验。
1、configure: error: No curses/termcap library found
网上有的说法是:–with-named-curses-libs=/usr/lib/libncursesw.so.5
其实是不对的,虽然能解决configure的错误,但是make的时候会提示错误,正确的做法应该是
centos: yum -y install ncurses-devel
debian: apt-get install libncurses5-dev
2、configure: error: xml2-config not found. Please check your libxml2 installation.
centos: yum -y install libxml2 libxml2-devel
debian: apt-get install libxml2-dev
3、configure: error: Cannot find OpenSSL’s
centos: yum -y install openssl-devel
4、configure: error: libjpeg.(a|so) not found
centos: yum -y install gd
centos: yum -y install gd-devel
debian: apt-get install libjpeg-dev
5、configure: error: libpng.(a|so) not found.
apt-get install libpng12-dev
6、configure: error: cannot find output from lex; giving up
yum -y install flex
7、configure: error: mod_deflate has been requested but can not be built due to prerequisite failures-编译php时的configure
centos: yum -y install zlib-devel openssl-devel
debian: apt-get install zlib1g-dev
8、configure: error: libxpm.(a|so) not found.
centos: yum -y install libxpm-dev
debian: apt-get install libxpm-dev
9、configure: error: freetype.h not found.
centos: yum install freetype-devel
debian: apt-get install libfreetype6-dev
10、configure: error: …No recognized SSL/TLS toolkit detected
centos: yum -y install libssl-dev
debian: apt-get install libssl-dev
11、Configure: error: Please reinstall the BZip2 distribution
centos: yum install bzip2 bzip2-devel
debian: apt-get install bzip2-devel
12、Configure: error: Please reinstall the libcurl distribution – easy.h should be in /include/curl/
centos: yum install curl curl-devel (For Redhat Fedora)
# install libcurl4-gnutls-dev (For Ubuntu)
13、Configure: error: Unable to locate gmp.h
centos: yum install gmp-devel
14、Configure: error: Cannot find MySQL header files under /usr. Note that the MySQL client library is not bundled anymore!-编译php时的configure
yum install mysql-devel (For Redhat Fedora)
# apt-get install libmysql++-dev (For Ubuntu)
15、Configure: error: Please reinstall the ncurses distribution
Solutions :
centos: yum install ncurses ncurses-devel
16、Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!-编译php时的configure
Solutions :
centos: yum install unixODBC-devel
17、Configure: error: Cannot find pspell
Solutions :
centos: yum install pspell-devel
18、configure: error: mcrypt.h not found. Please reinstall libmcrypt.
Solutions :
yum install libmcrypt libmcrypt-devel (For Redhat Fedora)
# apt-get install libmcrypt-dev
19、Configure: error: snmp.h not found. Check your SNMP installation.
Solutions :
yum install net-snmp net-snmp-devel
20、开启LDAP服务还需要
yum -y install openldap-devel openldap-servers openldap-clients
21、configure: error: cannot find output from lex; giving up
centos: yum -y install flex
22、configure: error: mod_deflate has been requested but can not be built due to prerequisite failures-编译php时的configure
centos: yum -y install zlib-devel openssl-devel
debian: apt-get install zlib1g-dev
我发现我在操作PHP的时候,在Linux下安装PHP过程中,编译时出现configure: err
其实有些东西我也讲不太清楚,你可以参考下我的意见。nxu安装 PHP:
yum -y install libxml2 libxml2-devel 下载安装libxml2,通过libxml2编译安装PHP
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-编译php时的configure
最保险的方法是,多去后盾人看一下教学视频,这样更加有用。
编译安装php时出错configure: error: build test failed.
对于PHP在./configure的时候出现下面问题:
checking whether to enable LIBXML support... yes
checking libxml2 install dir... /usr/local/libxml2/
checking for xml2-config path... /usr/local/libxml2//bin/xml2-config
checking whether libxml build works... no
configure: error: build test failed. Please check the config.log for details.
#按照提示我们查看php安装目录下的config.log文件,搜索xml2-config
[root@lamp-lnmp php-5.6.40]# vim config.log
#发现下面内容:
configure:23104: checking for xml2-config path
configure:23118: result: /usr/local/libxml2//bin/xml2-config
configure:23262: checking whether libxml build works
configure:23289: cc -o conftest -g -O2 -fvisibility=hidden -pthread -D_REENTRANT -Wl,-rpath,/usr/local/libxml2/lib -L/usr/local/libxml2/lib conftest.c-编译php时的configure
-lrt -lm -ldl -lnsl -lxml2 -lz -lm -ldl 5
configure:23289: $? = 0
configure:23289: ./conftest
./conftest: /lib64/libz.so.1: version `ZLIB_1.2.3.3' not found (required by /usr/local/libxml2/lib/libxml2.so.2)-编译php时的configure
configure:23289: $? = 1
configure: program exited with status 1
configure: failed program was:
#我们这里查看一下这个/lib64/libz.so.1的文件,发现链接到一个旧的libz文件中,这里将/lib64/libz.so.1软连接到新文件/usr/local/lib/libz.so.1.2.11中进行下面设置。-编译php时的configure
[root@lamp-lnmp ~]# ln -sf /usr/local/lib/libz.so.1.2.11 /lib64/libz.so.1
[root@lamp-lnmp ~]# ls -l /lib64/libz.so.1
lrwxrwxrwx 1 root root 29 Feb 2 11:13 /lib64/libz.so.1 - /usr/local/lib/libz.so.1.2.11
哪些是编译php时的常用configure参数
./configure –prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --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 --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-pdo --with-pdo-mysql --with-mysql -编译php时的configure
参数详解可以看看这里:
希望能帮到您。
安装php时显示configure error jpeglib.h not found该怎么解决?
在Linux下安装PHP过程中,编译时出现configure: error: libjpeg.(a|so) not found 错误的解决办法:
检查之后发现已经安装了libjpeg
[root@localhost php-5.2.14]# yum list installed|grep libpng
libpng.x86_64 2:1.2.49-1.el6_2
或者:
[root@localhost php-5.2.14]# rpm -qa|grep libjpeg
libjpeg-turbo-1.2.1-3.el6_5.x86_64
安装libjpeg-devel
yum -y install libjpeg-devel
[root@localhost php-5.2.14]# yum list installed|grep libjpeg
libjpeg-turbo.x86_64 1.2.1-3.el6_5 @base
libjpeg-turbo-devel.x86_64
[root@localhost php-5.2.14]# rpm -ql libjpeg-turbo-devel.x86_64
/usr/include/jconfig.h
/usr/include/jerror.h
/usr/include/jmorecfg.h
/usr/include/jpeglib.h
/usr/lib64/libjpeg.so
/usr/share/doc/libjpeg-turbo-devel-1.2.1
/usr/share/doc/libjpeg-turbo-devel-1.2.1/coderules.txt
/usr/share/doc/libjpeg-turbo-devel-1.2.1/example.c
/usr/share/doc/libjpeg-turbo-devel-1.2.1/jconfig.txt
/usr/share/doc/libjpeg-turbo-devel-1.2.1/libjpeg.txt
/usr/share/doc/libjpeg-turbo-devel-1.2.1/structure.txt
但是在/usr/lib目录下没有libjpeg.so这个文件,在/usr/lib64下是有的,虽然使用–with-jpeg-dir=/usr/lib64 依然无效,最后用
[root@ ~]#ln -s /usr/lib64/libjpeg.so.62 /usr/lib/libjpeg.so
问题解决。