安装php7.2
在Ubuntu上安装php7.2、php7.3、php7.4
https://www.cnblogs.com/niuben/p/13329434.html#%E6%9B%B4%E6%96%B0ubuntu
更新Ubuntu
sudo apt-get -y update && sudo apt-get upgrade
添加PHP存储库
sudo apt-get -y install software-properties-common
添加PHP存储库
sudo add-apt-repository ppa:ondrej/php
更新安装包
sudo apt-get -y update
安装php7.2
sudo apt-get -y install php7.2
安装PHP 7.2模块
sudo apt-get -y install php-pear php7.2-fpm php7.2-curl php7.2-dev php7.2-gd php7.2-gmagick php7.2-mbstring php7.2-zip php7.2-mysql php7.2-pgsql php7.2-xml php7.2-redis php7.2-swoole
安装composer
https://pkg.phpcomposer.com/#how-to-install-composer
删除apache2
sudo apt-get purge apache2
sudo apt autoremove
sudo apt autoclean
安装mysql
sudo apt-get install mysql-server
安装postgresql
sudo apt -y install postgresql postgresql-contrib
安装nginx
sudo apt -y install nginx
安装redis
sudo apt -y install redis-server
安装supervisor
sudo apt-get -y install supervisor
修改运行nginx的用户
vim /etc/nginx/nginx.conf
user www-data;修改为 user jypony;
service nginx restart
修改php-fpm的监听端口跟运行用户
user = jypony
group = jypony
listen = 127.0.0.1:9000
listen.owner = jypony
listen.group = jypony
重启php-fpm
service php7.2-fpm restart
评论 (0)