安装中文支持,避免一些语言相关的坑

1
2
3
4
5
6
7
8
sudo apt-get install language-pack-zh-hans

sudo vim /etc/default/locale

LANG="en_US.UTF-8"
LANGUAGE="zh_CN.utf8"
LC_ALL="zh_CN.utf8"

安装 PHP

此处安装的是 PHP 7.2,简单起见,我们直接使用现成的 package(当然了,你也可以使用源码编译)。

1
2
3
4
5
6
7
8
9
10
# 安装了此软件才能使用 PPA 呀
sudo apt-get install -y software-properties-common # 安装 PPA
sudo add-apt-repository ppa:ondrej/php sudo apt-get update # 安装 PHP 7.2,如果需要额外的拓展,可以后期再安装
sudo apt-get install php7.2

php 调优

我们即将使用 nginx 配合 php-fpm 使用,所以配置文件路径为 /etc/php/7.2/fpm/php.ini

修改一个容易导致内存溢出的问题php.ini

修改 pcre.recursion_limit=5000

其他调整

1
2
3
大专栏  ubuntu 服务器 php 环境简单搭建ass="code">
max_input_vars = 20000

post_max_size = 50M

安装 fpm

1
sudo apt-get install php7.2-fpm

php-fpm 调优

修改 /etc/php/7.1/fpm/php-fpm.conf

1
2
emergency_restart_threshold = 10 
emergency_restart_interval = 1m

修改 PHP-FPM /etc/php/7.2/fpm/pool.d/www.conf

1
2
3
4
5
6
7
8
9
10
listen = 127.0.0.1:9000 
listen.allowed_clients = 127.0.0.1
pm.max_children = 51
pm.start_servers = 3
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.max_requests = 1000 slowlog = /var/log/$pool.log.slow
request_slowlog_timeout = 5s

安装 nginx

sudo apt-get install nginx

PHP7.2 拓展

1
sudo apt-get install php7.2-mbstring php7.2-xml php7.2-intl

ubuntu 服务器 php 环境简单搭建的更多相关文章

  1. ubuntu 14.04LTS 环境下搭建tftp服务器

    花费我一整天的时间在 ubuntu 14.04LTS 环境下搭建tftp服务器,网上好多资料参差不齐,简单来说,TFTP(Trivial File Transfer Protocol),是一个基于UD ...

  2. Ubuntu下hadoop环境的搭建(伪分布模式)

    Ubuntu下hadoop环境的搭建(伪分布模式) 一.必要资源的下载 1.Java jdk(jdk-8u25-linux-x64.tar.gz)的下载 具体链接为: http://www.oracl ...

  3. Ubuntu服务器WDCP可视化界面搭建注意

    title: Ubuntu服务器WDCP可视化界面搭建注意 前两天心血来潮,研究了下服务器搭建与部署. 领了个免费体验3天的vps服务器进行了实操. 在安装WDCP的时候遇到了些问题,网上大部分对问题 ...

  4. springmvc4环境简单搭建和定时任务

    之前复制粘贴创建了几个ssm的项目,然而回头让自己写的时候还是一头雾水,究其原因是spring的陌生.仅仅是写过几个helloworld而已.而且是照着写.我都不知道springmvc到底需要多少ja ...

  5. Ubuntu下java环境的搭建

    喜欢捣鼓计算机相关的,然后大二的时候就想着用linux,于是当时就装了个ubuntu,还想着把java环境搭建进去,但当时由于"意志不坚定"后来就没用linux了,知道最近突然想在 ...

  6. 再写一篇ubuntu服务器的环境配置文

    三年前写过一篇,但是环境和三年前比已经发生了比较大的变化,于是重新写一篇,自己以后再次配置也比较方便.我个人而言并没有觉得centos比ubuntu好用多少,所以继续选用ubuntu. 一.硬盘分区  ...

  7. Ubuntu系统开发环境完整搭建

    安装搜狗输入法 点击我下载哦 idea快捷键冲突 输入发占用快捷键.撤掉输入法的快捷键.还有系统自带快捷键也要取消. 安装deepin-terminal 在tools工具包中找到deepin-term ...

  8. 阿里云服务器php环境的搭建

    1 sudo apt-get update 更新源 sudo apt-get install apache2##################备注:如果这时候发现无法访问公网ip, 请去配置阿里云后 ...

  9. ubuntu 下交叉编译环境的搭建

    1. 安装标准的C开发环境,由于Linux安装默认是不安装的,所以需要先安装一下(如果已经安装好的话,就可以免去这一步了): #sudo apt-get install gcc g++ libgcc1 ...

随机推荐

  1. ActiveMQ消息队列的搭建

    今天来写下消息队列 一.首先介绍下什么是activeMQ? ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线.ActiveMQ 是一个完全支持JMS1.1和J2EE 1.4规范的 ...

  2. 集成通用Mapper

    通用Mapper集成 1.引入jar包 <mapper.version>3.0.1</mapper.version><persistence-api.version> ...

  3. 【转】 java类的加载和执行顺序

    1.先执行Test类的静态代码块后执行Test类的main方法,说明要执行类的方法需要先加载这个类. 2.在创建ClassB的对象时,先去加载了父类ClassA.说明加载子类时如果没有加载父类,会先加 ...

  4. dlib安装踩过的坑

    使用到dlib时遇到了下载错误,不能正常安装 以下是成功安装的记录: 首先打开Anaconda prompt选定一个python环境,安装cmake和boost pip install cmake - ...

  5. org.springframework.web.util.UriComponentsBuilder

    import org.springframework.web.util.UriComponentsBuilder; UriComponentsBuilder.fromHttpUrl("htt ...

  6. 吴裕雄--天生自然python TensorFlow图片数据处理:No module named 'tensorflow.examples.tutorials'解决办法

    import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_dat ...

  7. rsync+nfs+sersync实战案例

    回顾: 1.rsync 统一备份各个服务器的配置文件或重要文件 系统配置文件 日志文件 系统日志文件 messages.secure.cron 服务日志文件 access_log.access.log ...

  8. 初识数据库MySQL

    一.认识数据库  1:什么是数据(Data) 描述事物的符号记录被称为数据,这个符号可以是数字,文字,图片,声音,语言等 2:什么是数据库(DataBase,简称DB) 数据库是存放数据的仓库,库一般 ...

  9. Flume(三) —— 断点续传 与 事务

    断点续传 # Name the components on this agent a1.sources = r1 a1.sinks = k1 a1.channels = c1 # Describe / ...

  10. Solving ordinary differential equations I(Nonstiff Problems),Exercise 1.2:A wrong solution

    (Newton 1671, “Problema II, Solutio particulare”). Solve the total differential equation $$3x^2-2ax+ ...