./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/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 --disable-rpath --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 --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear --with-zlib --enable-pdo --with-pdo-mysql
系统版本:
问题:
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
解决:
yum -y install libxml2
yum -y install libxml2-devel
问题:
configure: error: Cannot find OpenSSL's <evp.h>
解决: yum -y install openssl
yum -y install openssl-devel
问题:
checking for cURL support... yes
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
解决:
yum -y install curl
yum -y install curl-devel
checking for FreeType 2... yes
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try --with-webp-dir=<DIR>
configure: error: jpeglib.h not found.
解决:
yum -y install libjpeg
yum -y install libjpeg-devel
问题:
checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try --with-webp-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
configure: error: png.h not found.
解决:
yum -y install libpng
yum -y install libpng-devel
问题:
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.
解决:
yum -y install freetype
yum -y install freetype-devel
问题:
checking for LDAP Cyrus SASL support... yes
checking size of long int... 8
checking size of long int... (cached) 8
configure: error: Cannot find ldap.h
解决:
yum list openldap
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
openldap.x86_64 2.4.44-5.el7 @anaconda
Available Packages
openldap.i686 2.4.44-5.el7 base
yum install openldap.x86_64
yum list openldap-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
openldap-devel.i686 2.4.44-5.el7 base
openldap-devel.x86_64 2.4.44-5.el7 base
yum install openldap-devel.x86_64
[root@iZbp19419cu2b8cdfbb43jZ php-7.0.7]# yum list openldap-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
openldap-devel.i686 2.4.40-16.el6 base
openldap-devel.x86_64
继续编译
checking for LDAP Cyrus SASL support... yes
checking size of long int... 8
configure: error: Cannot find ldap libraries in /usr/lib.
解决:cp -frp /usr/lib64/libldap* /usr/lib/
问题:
checking for mcrypt support... yes
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
解决:
yum install -y libmcrypt-devel
问题:
checking for specified location of the MySQL UNIX socket... no
mysql_config not found
configure: error: Please reinstall the mysql distribution
which mysql_config
checking for XSL support... yes
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
解决:
make
/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_strdup'
/usr/lib64/liblber-2.4.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
解决:
./configure --with-ldap=shared
ln -s /usr/lib64/liblber* /usr/lib/
问题:
[root@izbp19419cu2b8cdfbb43jz php-7.0.7]# php -v
-bash: php: command not found
解决: ln -s /usr/local/php/bin/php /usr/bin/php
启动php-fpm遇到问题:
ERROR: failed to open configuration file '/usr/local/php/etc/php-fpm.conf': No such file or directory (2)
解决:cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
找到文件/usr/local/php/etc/php-fpm.conf中对应行:include=/usr/local/php/etc/php-fpm.d/*.conf
cd /usr/local/php/etc/php-fpm.d/ && ll
cp www.conf.default www.conf
重新启动php-fpm