在ubuntu14.04 LTS 上 安装php7.2和nginx

sudo apt-get install software-properties-common python-software-properties

# 如果之前有其他版本PHP,先卸载

sudo apt-get autoremove php5 php5-fpm php7

sudo add-apt-repository ppa:ondrej/php && sudo apt-get update

sudo apt-get -y install php7.2

 

# 安装常用扩展
sudo -y apt-get install php7.2-fpm php7.2-mysql php7.2-curl php7.2-json php7.2-mbstring php7.2-xml  php7.2-intl

#  安装其他扩展(按需安装)
sudo apt-get install php7.2-gd
sudo apt-get install php7.2-soap
sudo apt-get install php7.2-gmp
sudo apt-get install php7.2-odbc
sudo apt-get install php7.2-pspell
sudo apt-get install php7.2-bcmath
sudo apt-get install php7.2-enchant
sudo apt-get install php7.2-imap
sudo apt-get install php7.2-ldap
sudo apt-get install php7.2-opcache
sudo apt-get install php7.2-readline
sudo apt-get install php7.2-sqlite3
sudo apt-get install php7.2-xmlrpc
sudo apt-get install php7.2-bz2
sudo apt-get install php7.2-interbase
sudo apt-get install php7.2-pgsql
sudo apt-get install php7.2-recode
sudo apt-get install php7.2-sybase
sudo apt-get install php7.2-xsl
sudo apt-get install php7.2-cgi
sudo apt-get install php7.2-dba
sudo apt-get install php7.2-phpdbg
sudo apt-get install php7.2-snmp
sudo apt-get install php7.2-tidy
sudo apt-get install php7.2-zip

其他

  • php端口配置

sudo vi /etc/php/7.2/fpm/pool.d/www.conf

注释行      ;listen = /run/php/php7.2-fpm.sock
新加行       listen = 127.0.0.1:9000

安装NGINX

sudo add-apt-repository ppa:nginx/stable

sudo apt-get install nginx

  • nginx 配置

sudo vi /etc/nginx/sites-available/default

fastcgi_pass 127.0.0.1:9000;

 

原文链接:https://blog.csdn.net/qq_16885135/article/details/79747045

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注