欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ubuntu安装Nginx+PHP5.6+MySQL5.6

程序员文章站 2022-03-03 14:41:18
...

首先更新PPA源:
vi /etc/apt/sources.list

deb http://ppa.launchpad.net/apt-fast/stable/ubuntu saucy main
deb-src http://ppa.launchpad.net/apt-fast/stable/ubuntu saucy main

sudo add-apt-repository ppa:tldm217/tahutek.net
sudo apt-get update
sudo apt-get install apt-fast

1、安装nginx:
$ sudo apt-get update
$ sudo apt-get install nginx

查看版本:
/usr/sbin/nginx -v

2、安装php5.6

添加ppa:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

查找php对应版本的扩展:
sudo apt-cache search php5.6

开始安装:
sudo apt-get install php5.6-fpm php5.6-mysql php5.6-common php5.6-curl php5.6-cli php5.6-mcrypt php5.6-mbstring php5.6-dom php5.6-gd php5.6-json php-memcached php-memcache php5.6-xml php5.6-zip php-http

php.ini配置文件:
$ sudo vim /etc/php/5.6/fpm/php.ini

nginx配置:

location ~ .php$ {
#include snippets/fastcgi-php.conf;
#With php7.0-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
#With php7.0-fpm:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;

}

3、安装mysql
sudo apt-get install mysql-server-5.6 mysql-client-5.6

转载于:https://blog.51cto.com/11910656/2171599