wget https://downloads.php.net/~ab/php-7.0.0alpha2.tar.bz2//用winscp把下载好的文件上传到网站中tar jxf php-7.0.0alpha2.tar.bz2安装:sudo apt-get updatesudo apt-get install libxml2-dev安装gccsudo apt-getinstallbuild-essentialsudo apt-get install openssl sudo apt-get install libssl-dev apt-get install makeapt-get install curlapt-get install libcurl4-gnutls-devsudo apt-get install libjpeg-devsudo apt-get install libpng-devsudo apt-get install libmcrypt-devsudo apt-get install libreadline6 libreadline6-devcd php-7*3. 编译./configure./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts./configure --prefix=/usr/local/php --enable-fpm --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache--with-mysql --with-mysqli --with-mysql-sock--enable-pdo --with-pdo-mysql --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --enable-bz2 --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear --with-libdir=/lib/x86_64-linux-gnu --with-gd --with-jpeg-dir=/usr/lib --enable-gd-native-ttf --enable-xml#安装 PHP make && make test make && sudo make install下面是对php-fpm运行用户进行设置 配置php-fpmcd /usr/local/php/etccp php-fpm.conf.default php-fpm.confvim php-fpm.conf修改user = www-data group = www-data如果www-data用户不存在,那么先添加www-data用户groupadd www-data useradd -g www-data www-data启动php-fpmsudo /usr/local/php/sbin/php-fpm加入系统变量sudo echo "PATH=$PATH:/usr/local/php/bin">> /etc/profile sudo echo "export PATH">> /etc/profile source /etc/profilephp -v
转自:http://www.oschina.net/question/2010961_242272?fromerr=5onf4qvG