apt-get install python-software-properties
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install php7.2
apt-get install php7.2-dev
apt-get install php-pear
安裝常用擴充套件
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 php7.2-gd
安裝其他擴充套件(按需安裝)
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
ln -s /etc/init.d/php7.2-fpm /etc/init.d/php
vim /etc/php/7.2/fpm/pool.d/www.conf
[port]
user = www-data
group = www-data
listen = 9000
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 30
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 30
pm.max_requests = 30
request_terminate_timeout = 300
request_slowlog_timeout = 120
slowlog = /var/log/slow.log
子系統如果使用原始碼編譯安裝會出現 訪問php頁面 一直轉圈。如果有好的解決方案 可以共享!
此配置目前日常開發作為本地環境比較方便 比安裝虛擬機器省資源
日常使用不太好 總是出現超時
建議直接 安裝php 然後安裝apache 不要使用NGINX
apt-get install apache2