有一个项目很老了,最开始用的php版本是5.3,如今换服务器,服务器是ubuntu16.04,默认的php版本是7.0,而后项目在这个版本上运行不起来。php
因而,就卸载了7.0,装一个5.6吧。python
apt-get install -y language-pack-en-base LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php add-apt-repository ppa:ondrej/php apt-get update apt-cache search php5 apt-get install php5.6-common apt-get install libapache2-mod-php5.6 apt-get install python-software-properties apt-get install software-properties-common apt-get update apt-get install php5.6 apt-get install php5.6-fpm #诸多扩展按需安装 apt-get install php5.6-curl apt-get install php5.6-gd apt-get install php5.6-mysql apt-get install php5.6-mbstring apt-get install php5.6-xsl apt-get install php5.6-xml apt-get install php5.6-dev
因为web服务器用的是nginx,须要更改配置文件里的fpm路径mysql
vi /etc/nginx/site-available/default
把原来的php7.0-fpm.sock改为php5.6-fpm.sock便可nginx