win10 ubuntu 子系统安装php

发布时间:2019-08-07 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了win10 ubuntu 子系统安装php脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

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

脚本宝典总结

以上是脚本宝典为你收集整理的win10 ubuntu 子系统安装php全部内容,希望文章能够帮你解决win10 ubuntu 子系统安装php所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。