Linux -安装PHP7

一个机器上,可以安装两个php,但是apache调用时,需要制定好cd /usr/local/src/wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2tar jxvf php-7.1.6.tar.bz2cd php-7.1.6./configure --prefix=/usr/l...

一个机器上,可以安装两个php,但是apache调用时,需要制定好

cd /usr/local/src/

wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2

tar jxvf php-7.1.6.tar.bz2

cd php-7.1.6

./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php7/etc --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

make && make install

ls /usr/local/apache2.4/modules/libphp7.so

cp php.ini-production /usr/local/php7/etc/php.ini

httpd指定php5还是php7
vi /usr/local/apache/conf/httpd.conf
注释一个就好

本文标题为:Linux -安装PHP7

基础教程推荐