Centos7 PHP7 编译安装 开机自启动
1、PHP7.0.13下载
- wget http://cn2.php.net/get/php-7.0.13.tar.gz/from/this/mirror
2、解压
- tar -zxvf php-7.0..tar.gz
3、 进入目录
- cd php-7.0.
4、下载扩展库
- yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel MySQL pcre-devel
- yum -y install curl-devel
- yum -y install libxslt-devel
5、编译安装
- ./configure --prefix=/usr/local/php7 \
- --with-curl \
- --with-freetype-dir \
- --with-gd \
--with-jpeg-dir \- --with-gettext \
- --with-iconv-dir \
- --with-kerberos \
- --with-libdir=lib64 \
- --with-libxml-dir \
- --with-mysqli \
- --with-openssl \
- --with-pcre-regex \
- --with-pdo-mysql \
- --with-pdo-sqlite \
- --with-pear \
- --with-png-dir \
- --with-xmlrpc \
- --with-xsl \
- --with-zlib \
- --enable-fpm \
- --enable-bcmath \
- --enable-libxml \
- --enable-inline-optimization \
- --enable-gd-native-ttf \
- --enable-mbregex \
- --enable-mbstring \
- --enable-opcache \
- --enable-pcntl \
- --enable-shmop \
- --enable-soap \
- --enable-sockets \
- --enable-sysvsem \
- --enable-xml \
- --enable-zip
- make && make install
6、拷贝配置文件
- cp php.ini-production /usr/local/php7/lib/php.ini
- vim /usr/local/php7/lib/php.ini
- cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
#把pid 改成 /run/php-fpm.pid
- vim /usr/local/php7/etc/php-fpm.conf
- cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
#listen = 127.0.0.1:9000 默认可不改
- vim /usr/local/php7/etc/php-fpm.d/www.conf
7、添加服务
- vim /etc/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/php7/sbin/php-fpm --nodaemonize --fpm-config /usr/local/php7/etc/php-fpm.conf
- ExecReload=/bin/kill -USR2 $MAINPID
- ExecStop=/bin/kill -SIGINT $MAINPID
- [Install]
- WantedBy=multi-user.target
8、启动php-fpm
- systemctl start php-fpm.service
9、添加到开机启动
- systemctl enable php-fpm.service
- systemctl enable *.service #开机运行服务
- systemctl disable *.service #取消开机运行
- systemctl start *.service #启动服务
- systemctl stop *.service #停止服务
- systemctl restart *.service #重启服务
- systemctl reload *.service #重新加载服务配置文件
- systemctl status *.service #查询服务运行状态
- systemctl --failed #显示启动失败的服务
- 修改 php.ini 文件 设置 expose_php = Off
- vim /usr/local/php7/etc/php.ini
- 找到 expose_php = On
- 改为 expose_php = Off
Centos7 PHP7 编译安装 开机自启动的更多相关文章
- centos7下编译安装php-7.0.15(PHP-FPM)
centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...
- centos7.6编译安装php7.2.11及redis/memcached/rabbitmq/openssl/curl等常见扩展
centos7.6编译安装php7..11及redis/memcached/rabbitmq/openssl/curl等常见扩展 获取Php的编译参数方法: [root@eus-api-cms-bac ...
- Linux Centos7.2 编译安装PHP7.0.2
操作环境: 1.系统:Centos7.2 2.服务:Nginx 1.下载PHP7.0.2的安装包解压,编译,安装: $ cd /usr/src/ $ wget http://cn2.php.net/d ...
- CentOS7中设置Tomcat8开机自启动
CentOS7中设置Tomcat8开机自启动 本文介绍了在centos7中配置tomcat的开机自启动的一些操作步骤,仅供参考. 环境是CentOS 7 ,jdk版本是1.8.0_191,tomcat ...
- CentOS7下编译安装redis-5.0.9
CentOS7下编译安装redis-5.0.9 本文地址http://yangjianyong.cn/?p=171转载无需经过作者本人授权 下载redis #code start wget https ...
- CentOS7.6编译安装openssl-1.1.1c
卸载旧版本OpenSSL # which openssl/usr/bin/openssl# mv openssl openssl.oldrm -rf /etc/ssl #删除配置文件 CentOS7. ...
- CentOS7.6编译安装Python-3.7.4
安装步骤 1. 下载安装包.wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz<说明>如果报SSL/TSL错误,则加 ...
- Centos7.2 编译安装PHP7
PHP7,编译安装: 环境:centos7.2 (注意:因为我用的nginx, 此配置参数没有考虑到apache,所以不合适需要用apache的朋友照搬过去运行,但是可以参考.) 直接下载P ...
- centos7下编译安装php7.3
一.下载php7.3的源码 https://www.php.net/downloads.php 下载php-7.3.4.tar.gz 二.安装gcc,gcc-c++,kernel-devel yum ...
随机推荐
- java.lang.IllegalThreadStateException
java.lang.IllegalThreadStateException 今天遇到了这个问题.当时的情景是想要循环实现了runable的类和继承Thread类的两个线程.可是没有注意到,继承自Thr ...
- html的textarea控制字数小案例
<h3>设计理念说明(200字以内)</h3> <textarea onkeyup="checkLen(this)"></textarea ...
- 多校3-Magician 分类: 比赛 2015-07-31 08:13 4人阅读 评论(0) 收藏
Magician Time Limit: 18000/9000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total ...
- javascript学习(一) 异常处理与简单的事件
一:异常处理 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></ti ...
- ubuntu下查看cpu信息
查看CPU信息cat /proc/cpuinfo 几个cpu more /proc/cpuinfo |grep "physical id"|uniq|wc -l 每个cpu是几核( ...
- SQL锁行 解决多台服务器发送统一请求并发问题
锁行信息SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED 存储过程:SET Transaction Isolation Level Read语法的四种情 ...
- HTTP 错误 404.2 - Not Found
前几天刚安装Windows Server 2008 r2 sp1 遇到问题之后,昨天我又遇到一个问题(但我不害怕有问题),提示: HTTP 错误 404.2 - Not Found由于 Web 服务器 ...
- 2016CCPC东北地区大学生程序设计竞赛 1008 HDU5929
链接http://acm.hdu.edu.cn/showproblem.php?pid=5929 题意:给你一种数据结构以及操作,和一种位运算,最后询问:从'栈'顶到低的运算顺序结果是多少 解法:根据 ...
- 公共控件Listview
ListView属性中,Items是行的总集合,Items集合中的每一个是一行,Items集合里面有ListViewItem集合,这个集合实例化:ListViewItem li=new ListVie ...
- Java IO流整理Rick
Java 流IO部分: Console 控制台信息读取// ----------- Console Begin // ------------ 部分代码 Console cons ; char[] ...