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
<a href="http://cn2.php.net/distributions/php-7.0.13.tar.gz" target="_blank">http://cn2.php.net/distributions/php-7.0.13.tar.gz</a>
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
<a href="http://s2.51cto.com/wyfs02/M01/8A/A6/wKioL1g2qHnTOzbrAAB9Xsi_Z4Y627.png-wh_500x0-wm_3-wmp_4-s_1549665607.png" target="_blank"></a>
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
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
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
本文轉自 skinglzw 51CTO部落格,原文連結:http://blog.51cto.com/skinglzw/1876268,如需轉載請自行聯系原作者