php7.0.7安装

编译参数:

./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


系统版本:

Linux version 2.6.32-696.16.1.el6.x86_64 (mockbuild@c1bl.rdu2.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Wed Nov 15 16:51:15 UTC 2017

问题:

checking libxml2 install dir... /usr
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


问题:

checking for pkg-config... /usr/bin/pkg-config
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 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>
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



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值