`# 安装依赖包
yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel \
libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel \
libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel \
ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5-devel \
openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers `# 下载源码包
wget -c http://mirrors.sohu.com/php/php-7.2.13.tar.gz `# 解压
tar -xzvf php-7.2.13.tar.gz
cd php-7.2.13 `# 预编译
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php \
--enable-mbstring --with-openssl --enable-ftp --with-gd --with-jpeg-dir=/usr \
--with-png-dir=/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd \
--with-pear --enable-sockets --with-freetype-dir=/usr --with-zlib --with-libxml-dir=/usr \
--with-xmlrpc --enable-zip --enable-fpm --enable-xml --enable-sockets --with-gd --with-zlib \
--with-iconv --enable-zip --with-freetype-dir=/usr/lib/ --enable-soap --enable-pcntl --enable-cli --with-curl `# 编译并安装
make && make install `# 拷贝配置文件和启动脚本
cp php.ini-development /usr/local/php/etc/php-fpm.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /root/php-7.2.25/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod o+x /etc/init.d/php-fpm `# 将php服务加入systemctl
`#(1)自定义添加启动服务文件
vim /usr/lib/systemd/system/php-fpm.service
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target [Service]
Type=simple
PIDFile=/run/php-fpm.pid
ExecStart=/usr/local/php/sbin/php-fpm --nodaemonize --fpm-config /usr/local/php/etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
ExecStop=/bin/kill -SIGINT $MAINPID [Install]
WantedBy=multi-user.target `#(2)添加环境变量
export PATH="$PATH:/usr/local/php/sbin" `#(3)在php.ini解析文件中加入
vim /usr/local/php/etc/php.ini
zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/opcache.so

最新文章

  1. Android 监听ScrollView的滑动
  2. jquery from提交和post提交
  3. easyui datagrid json 格式
  4. 转载:iOS 推送的服务端实现
  5. java.lang.NoClassDefFoundError: com/opensymphony/xwork2/util/TextUtils
  6. AlgorithmsI Programming Assignment 1: PercolationStats.java
  7. Stack-overflow, how to answer
  8. Amazon Aurora解读(SIGMOD 2017)
  9. C语言控制流语句
  10. [TFRecord格式数据]利用TFRecords存储与读取带标签的图片
  11. java之静态代理和动态代理
  12. aix 6.1系统怎么安装?这里有详细图文教程
  13. Navicat如何导出Excel格式表结构
  14. WinForm DataGridView 绑定泛型List(List<T>)/ArrayList不显示的原因和解决
  15. Content Security Policy介绍
  16. Elasticsearch 5.4.3实战--Java API调用:索引mapping创建
  17. Python游戏编程(Pygame)
  18. PHP基础架构
  19. java 数据类型和运算符
  20. OC,nil,NULL,Nil,kCFNull

热门文章

  1. 《JavaScript设计模式与开发实践》-- 迭代器模式
  2. java常用类Time
  3. [Hadoop]浅谈MapReduce原理及执行流程
  4. Pyinstaller打包scrapy
  5. 对pwntools生成的exp模版做了一些修改
  6. 「刷题」Triple
  7. 使用Typescript重构axios(二十五)——文件上传下载进度监控
  8. 通俗易懂了解Vue的计算属性
  9. 磁盘冗余阵列之RAID5的配置
  10. day8-函数