Home > Backend Development > PHP Tutorial > php7编译安装与php5共存

php7编译安装与php5共存

WBOY
Release: 2016-06-23 13:11:05
Original
1054 people have browsed it

1.下载  

wget  http://php.net/get/php-7.0.5.tar.gz/from/a/mirror
Copy after login

2.解压


tar zxvf php-7.0.5.tar.gzcd php-7.0.5
Copy after login

3.安装,由于原本5.5安装在 /usr/local/php 下面,所以新版的php7 我就安装到 /usr/local/php7 了


./configure --prefix=/usr/local/php7 \ --with-curl \ --with-freetype-dir \ --with-gd \ --with-gettext \ --with-iconv-dir \ --with-kerberos \ --with-libdir=lib64 \ --with-libxml-dir \ --with-mysqli \ --with-openssl \ --with-pcre-regex \ --with-pdo-mysql \ --with-pdo-sqlite \ --with-pear \ --with-png-dir \ --with-xmlrpc \ --with-xsl \ --with-zlib \ --enable-fpm \ --enable-bcmath \ --enable-libxml \ --enable-inline-optimization \ --enable-gd-native-ttf \ --enable-mbregex \ --enable-mbstring \ --enable-opcache \ --enable-pcntl \ --enable-shmop \ --enable-soap \ --enable-sockets \ --enable-sysvsem \ --enable-xml \ --enable-zip
Copy after login

4.配置

cp php.ini-production /usr/local/php7/etc/php.inicp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.confcp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.confcp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm7
Copy after login



php7中www.conf这个配置文件配置phpfpm的端口号,修改 usr/local/php7/etc/php-fpm.d/www.conf

5.出现错误

    xsl 相关错误
    现象:configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
    解决办法:yum install -y libxslt libxslt-devel libxml2 libxml2-devel

 make错误: make: *** [sapi/cli/php] error 1

   解决办法:make ZEND_EXTRA_LIBS='-liconv'








Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template