您的位置:首页 > 编程语言 > PHP开发

ubuntu 14.0.4LTS安装LNMP php7.0(主要用于个人笔记 勿喷)

2015-12-23 15:50 543 查看
开启ubutnu后联网开始安装

1、更新包

sudoapt-getupdate

2、去安装add-apt-repository

sudoapt-getinstallpython-software-properties

sudo
apt-get
install
software-properties-common


3、安装php7.0来源包




sudo
LC_ALL=en_US.UTF-8
add-apt-repository
ppa:ondrej/php

4、更新包


sudoapt-getupdate


5、安装php7


sudo
apt-getinstall
php7.0
php7.0-fpm
php7.0-mysql

6、安装nginx

sudoapt-getinstallnginx

7、安装mysql

sudoapt-getinstallmysql-service-5.6

8、让nginx链接php-fpm

把fastcgi_passunix:/var/run/php/php5-fpm.sock;

改成fastcgi_passunix:/var/run/php/php7-fpm.sock;

取消location~\.php${}的注释

注释fastcgi_pass127.0.0.1:9000
9、设置/etc/php/7.0/fpm/pool.d/www.conf(若出现502在执行下面两步)

把listen=/run/php/php7.0-fpm.sock

换成listen=127.0.0.1:9000

注释fastcgi_passunix:/var/run/php/php7-fpm.sock;

10、设置/etc/nginx/sites-available/default

把index index.htmlindex.htm;改成

indexindex.phpindex.htmlindex.htm;

在添加一行fastcgi_pass127.0.0.1:9000;

重启php-fpm7.0服务和nginx服务
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: