1. 程式人生 > >php7.1源碼包安裝

php7.1源碼包安裝

php php7.1 php7.1安裝

安裝php7

下載與解壓

cd /usr/local/src/
wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2
tar jxvf php-7.1.6.tar.bz2

安裝php

cd /usr/local/src/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-mysql=/usr/local/mysql --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

設置配置文件

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

兩版本PHP沖突處理

如果安裝了php5後又安裝了php7,那麽調用Apache調用只能用其中一個;
那麽就需要修改配置文件
vim /usr/local/apache2.4/conf/httpd.conf
不想要php5就註釋掉LoadModule php5_module modules/libphp5.so
不想要php7就註釋掉LoadModule php7_module modules/libphp7.so

查詢Apache加載的模塊

/usr/local/apache2.4/bin/apachectl -M

php7.1源碼包安裝