sudo apt-get install nginx

cd /etc/nginx/sites-enabled

vi /etc/nginx/sites-available/default(配置文件就是这个,其他没必要改)

/etc/init.d/nginx start  启动

systemctl status nginx.service  查看状态


cd /etc/nginx/sites-available

vi default

在用vi编辑时,用ctrl+g就可以显示行号

:nu   命令显示当前光标所在行的行号

location ~ \.php$ {

           include snippets/fastcgi-php.conf;

           fastcgi_pass 127.0.0.1:9000;

           #fastcgi_pass unix:/run/php/php7.0-fpm.sock;

        }

cd /var/www/html


http://cn2.php.net/distributions/php-7.0.13.tar.gz

tar -zxvf php-7.0.13.tar.gz

cd php-7.0.13

./configure --help

./configure --prefix=/home/skinglzw8/php-7.0.13 --with-pdo-mysql --enable-fpm --with-libdir=lib64 --disable-cli

./configure --prefix=/home/linzw/local/php-7.0.13 --with-pdo-mysql --enable-fpm --with-libdir=lib64 --disable-cli --enable-debug

报错的话,看缺少什么,安装下,我是缺少下面这些,装完,php7就安装成功了

 apt-get install libxml2-dev

 apt-get install libxml2

 yum -y install libxml2-devel

wKioL1g2qHnTOzbrAAB9Xsi_Z4Y627.png-wh_50

cd /php-7.0.13

cp php.ini-development php.ini

cd /php-7.0.13/etc

cd /home/skinglzw8/php-7.0.13/etc/php-fpm.d

cd /php-7.0.13/etc/php-fpm.d

cp www.conf.default www.conf

cd /home/skinglzw8/php-7.0.13/sapi/fpm/

cp ./init.d.php-fpm /etc/init.d/php-fpm


groupadd nobody

cd /etc/init.d

bash ./php-fpm start


cd /home/skinglzw8/php-7.0.13/etc/php-fpm.d

vi www.conf

pm.max_children=10

pm.start_servers=4

pm.min_spare_servers=2

pm.max_spare_servers=10

min_spare_servers + (max_spare_servers - min_spare_servers) / 2


---------------------------------

ubuntu安装php7

apt-cache search php7

apt-get install php7.0-dev