PHP安装

服务器使用nginx时,需要使用php-fpm。所以PHP安装需要通过编译源码来安装。

下载源码包

wget http://cn2.php.net/get/php-7.1.1.tar.gz/from/this/mirrort

配置

cd ../php-x.x.x
./configure --prefix=/usr/local/php --enable-fpm --with-mysql --with-pear --with-curl --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir  --with-iconv --with-mcrypt --with-mhash --with-zlib --with-xmlrpc --with-xsl  --with-openssl --with-mysql --with-mysqli --with-pdo-mysql --enable-zip --enable-sockets --enable-soap --enable-mbstring --enable-magic-quotes --enable-inline-optimization --enable-memory-limit --enable-xml --enable-ftp --enable-exif --enable-wddx --enable-bcmath --enable-calendar --enable-sqlite-utf8 --enable-shmop --enable-dba --enable-sysvsem --enable-sysvshm --enable-sysvmsg 

make

make
sudo make install

你可能感兴趣的:(PHP安装)