1  安装php所需要的扩展

     yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel curl curl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel  gd gd-devel 
2 安装php

   ./configure --prefix=/usr/local/php7.2 --enable-shared --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-libxml-dir --with-openssl --with-curl --with-zlib-dir -with-gettext --with-jpeg-dir --with-png-dir --with-bz2 --with-freetype-dir --with-iconv --with-config-file-path=/usr/local/php7.2/etc --enable-mbstring --with-gd --disable-debug --enable-short-tags --disable-posix --enable-exif --enable-ftp --enable-sockets --with-mhash --enable-zip --enable-opcache --enable-inline-optimization

   make

   make install

   cp php.ini-production /usr/local/php7.2/etc/php.ini
    
3 编辑php配置文件

   编辑 php.ini文件  设置如下

short_open_tag = On

disable_functions = "dl,exec,passthru,pcntl_exec,popen,posix_kill,posix_mkfifo,posix_setuid,proc_close,proc_open,proc_terminate,shell_exec,system,leak,posix_setpgid,posix_setsid,proc_get_status,proc_nice,show_source"

cgi.fix_pathinfo=0

date.timezone = Asia/Shanghai
expose_php = Off

4 编辑php-fpm配置文件

cp php-fpm.conf.default  php-fpm.conf

  编辑  php-fpm.conf  设置如下

  pid = /usr/local/php7/var/run/php-fpm.pid

  error_log = log/php-fpm.log

  log_level = notice

   process_control_timeout = 30

  events.mechanism = epoll

  listen = 127.0.0.1:9007

   listen.backlog = -1

   pm.max_children = 1024

    pm.start_servers = 80

    pm.min_spare_servers = 20

    pm.max_spare_servers = 80

    pm.max_requests = 2000

    pm.status_path = /status

    ping.path = /ping

    ping.response = pong

    slowlog =  var/log/phpslow_$pool.log

    request_slowlog_timeout = 5s

    request_terminate_timeout = 60s

     rlimit_files = 65534

    php_admin_value[open_basedir] = "/tmp/"
php_admin_value[disable_functions] = dl,exec,leak,passthru,pcntl_exec,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,system
4 测试php

   #测试php-fpm配置
/usr/local/php7.2/sbin/php-fpm -t
/usr/local/php7.2/sbin/php-fpm -c /usr/local/php7/etc/php.ini -y /usr/local/php7.2/etc/php-fpm.conf -t #启动php-fpm
/usr/local/php7.2/sbin/php-fpm
/usr/local/php7.2/sbin/php-fpm -c /usr/local/php7/etc/php.ini -y /usr/local/php7.2/etc/php-fpm.conf #关闭php-fpm
kill -INT `cat /usr/local/php7.2/var/run/php-fpm.pid` #重启php-fpm
kill -USR2 `cat /usr/local/php7.2/var/run/php-fpm.pid`

centos7.2 64位安装php7.2.12的更多相关文章

  1. centos7.4 64位安装 google-chrome 与 chromedriver 运行 Python selenium 项目

    centos7.4 实例 利用 yum 命令安装 google-chrome 超级简单(安装最新版): yum install https://dl.google.com/linux/direct/g ...

  2. centos7.3 64位 安装git

    1.安装编译git时需要的包 # yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel # yum ins ...

  3. centos7.2 64位安装java

    1.  wget http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk- ...

  4. centos7.4 64位安装 git

    参考博客:Linux Jenkins配置Git 1. git --version 查看有没有安装 过 git,没有则 继续 2. git 压缩包下载地址:https://mirrors.edge.ke ...

  5. centos7.4 64位安装 redis-4.0.0

    1.  下载 redis 包 链接:https://pan.baidu.com/s/1g1UE_GTreXoD9uOXB7G3HA 提取码:ug8p 2. 安装gcc.ruby .rubygems等环 ...

  6. hadoop2.6.0汇总:新增功能最新编译 32位、64位安装、源码包、API下载及部署文档

    相关内容: hadoop2.5.2汇总:新增功能最新编译 32位.64位安装.源码包.API.eclipse插件下载Hadoop2.5 Eclipse插件制作.连接集群视频.及hadoop-eclip ...

  7. Ubuntu14.04(64位)安装ATI_Radeon_R7_M265显卡驱动

    电脑型号:Dell inspiron 14-5447 笔记本 显卡配置:集成显卡Intel核心显卡,Cpu是i5-4210U;独立显卡ATI_Radeon_R7_M265 网上关于ATI/Intel双 ...

  8. Windows7 64位安装最新版本MySQL服务器

    Windows7 64位安装最新版本MySQL服务器 近期,一直在研究MySQL数据库,经常修改配置文件,导致MySQL数据库无法使用,不得不反复重装MySQL数据库.以下是在Windows7 64位 ...

  9. ubuntu14.04 64位 安装eclipse

    ubuntu14.04 64位 安装eclipse 1 在官网上下载eclipse http://www.eclipse.org/downloads/下载eclipse-jee-luna-SR1-li ...

  10. Windows7 64位安装最新版本号MySQLserver

    Windows7 64位安装最新版本号MySQLserver 最近,一直在研究MySQL数据库.常常改动配置文件.导致MySQL数据库无法使用.不得不重复重装MySQL数据库.下面是在Windows7 ...

随机推荐

  1. 监听异常:The listener supports no services

    数据库版本:单机环境19c 实例是正常的 [oracle@sit19c admin]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Produ ...

  2. 第14周 预习、实验与作业:Java数据库编程

    回想"流与文件"章节,如何将一组对象存储到文件中?主要步骤是什么. 把数据抽象为流,用字节输入输出流(InputStream,OutputStream)进行读写. 主要步骤为:创建 ...

  3. 大数据算法与分析_pdf

    链接:https://pan.baidu.com/s/1ksU_Zt1pVZzQ0MmURgoi_w 提取码:r92u

  4. vue iframe网页内嵌及传参

    思路 通过域名传参做并加密处理 内嵌页面通过域名来接收参数并解密 外套页面 <iframe :src="url" scrolling="yes" back ...

  5. 93、springboot 和springcloud版本对比

    https://start.spring.io/actuator/info 建议转为json

  6. Go 设置代理

    对于 Windows 用户,可以在PowerShell中设置: $env:GOPROXY = "https://goproxy.io"

  7. fabric2.2学习笔记1

    fabric2.2学习笔记1 20201303张奕博 2023年1月9日 hyperledger fabric 结构分析 每个Server作用: AdminServer:控制该节点的命运,可以删除该节 ...

  8. Path类,文件操作的路径用法

    using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Tex ...

  9. ubuntu 20.04 更新镜像源

    首先备份系统自带的源,以防修改错误! 命令: sudo cp /etc/apt/sources.list /etc/apt/sources.list.back 1.修改系统镜像源 文件目录:/etc/ ...

  10. iOS加载动态自定义字体

    iOS加载动态自定义字体  NSString *cachePath = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDom ...