RedHat7上安装PHP
编译安装PHP
- 下载PHP
# wget http://cn2.php.net/distributions/php-7.0.0.tar.gz - 解压缩PHP
# tar -zxvf php-7.0.0.tar.gz && cd php-7.0.0 - 安装依赖软件
# yum -y install gcc libxml2-devel - 编译安装PHP
这里设置php-fpm运行的用户名和组为nginx,如果不存在,需要创建
# useradd -r -M -s /sbin/nologin nginx
然后运行下面的命令进行编译安装php
# ./configure --prefix=/usr/local/php7 --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx
# make && make install - 复制文件到正确的位置
# cp php.ini-production /usr/local/php7/php.ini
# cp /usr/local/php7/etc/php-fpm.conf.default /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
# cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm - 设置php-fpm服务开机自启动
# chmod +x /etc/init.d/php-fpm
# chkconfig php-fpm on - 修改/usr/local/php7/php.ini文件
cgi.fix_pathinfo=
date.timezone = PRC - 启动php-fpm服务
# service php-fpm start
备注:
使用下面编译参数进行编译时,需要先安装相关依赖包
# yum -y install gcc libxml2-devel openssl-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel libc-client-devel libmcrypt-devel libxslt-devel
# ln -sv /usr/lib64/libc-client.so /usr/lib/libc-client.so
编译参数列表:
# ./configure --prefix=/usr/local/php7 \
--with-mcrypt \
--with-mhash \
--with-openssl \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-mysqlnd \
--with-gd \
--with-iconv \
--with-zlib \
--enable-zip \
--enable-inline-optimization \
--disable-rpath \
--enable-xml \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-mbregex \
--enable-mbstring \
--enable-gd-native-ttf \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--without-pear \
--with-curl \
--with-jpeg-dir \
--with-png-dir \
--with-iconv-dir \
--with-freetype-dir \
--with-libxml-dir \
--with-zlib-dir \
--with-gettext \
--without-gdbm \
--disable-fileinfo \
--with-fpm-user=nginx \
--with-fpm-group=nginx \
--with-kerberos \
--with-imap \
--with-imap-ssl \
--enable-exif \
--with-pcre-regex \
--enable-sysvshm \
--enable-calendar \
--enable-xmlreader \
--enable-xmlwriter \
--enable-static \
--with-xsl \
--enable-ftp \
--enable-opcache \
--enable-fpm \
--enable-session \
--disable-fileinfo
yum安装PHP
- 安装PHP
# yum -y install php php-fpm php-mysql - 修改/etc/php.ini文件
cgi.fix_pathinfo=
date.timezone = PRC - 修改/etc/php-fpm.d/www.conf文件
使用nginx用户和用户组来运行php-fpm服务
user = nginx
group = nginx - 设置php-fpm服务开机自启动
# systemctl enable php-fpm - 启动php-fpm服务
# systemctl start php-fpm
RedHat7上安装PHP的更多相关文章
- RedHat7上安装MySQL5.7.16
1.查看系统中是否已将安装MySQL,如果安装了,需要卸载. [root@chenguo etc]# rpm -qa|grep -i mysql 2.创建用户和组 [root@chenguo ~]# ...
- redhat7 上安装dummynet
更多请访问 http://www.webpersonaldeveloper.cn 摘要: 在redhat 上部署dummynet 需要将ipfw 编译为内核模块,而ipfw需要调用linux kern ...
- RedHat7上安装MariaDB
编译安装MariaDB 下载MariaDB# wget http://mirrors.opencas.cn/mariadb//mariadb-10.1.8/source/mariadb-10.1.8. ...
- 在虚拟机VMware上安装Linux系统教程
目录: 一. CentOS的安装 二. RedHat的安装 三. VMwaretools的安装 此处提供CentOS和RedHat两个版本的系统安装流程,至于选哪个 ...
- [转帖]redhat7.6Linux安装Oracle19C完整版教程
redhat7.6Linux安装Oracle19C完整版教程 https://www.oracle.com/technetwork/database/enterprise-edition/downlo ...
- RedHat7.4安装在个人电脑(笔记本)中安装遇到的问题总结
RedHat7.4安装在个人电脑(笔记本)中安装 以下纯属个人在安装过程中遇到问题的一些总结,如果有描述不恰当的地方,还请给予指出,欢迎大家评论和交流. 物理主机的配置: 硬件配置: 华硕A456U笔 ...
- 在centos7上安装Jenkins
在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...
- 记录在Windows上安装和使用Oracle数据库过程中的坑
1.安装Oracle Oracle软件是免费的,可以去官网下载相应的安装包.但是如果用于商业用途需要购买License.官网上针对各种平台,32位和64位都有,如果在Windows一般会下载到两个文件 ...
- raspberrypi(树莓派)上安装mono和jexus,运行asp.net程序
参考网址: http://www.linuxdot.net/ http://www.cnblogs.com/mayswind/p/3279380.html http://www.raspberrypi ...
随机推荐
- ANDROID_MARS学习笔记_S05_001_用SensorManager获取传感器
1. public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentV ...
- ANDROID_MARS学习笔记_S04_002_用AsyncTask实现异步操作
一.简介 二.代码1.xml(1)activity_main.xml <?xml version="1.0" encoding="utf-8"?> ...
- C++内存管理(超长,例子很详细,排版很好)
[导语] 内存管理是C++最令人切齿痛恨的问题,也是C++最有争议的问题,C++高手从中获得了更好的性能,更大的自由,C++菜鸟的收获则是一遍一遍的检查代码和对C++的痛恨,但内存管理在C++中无处不 ...
- MySQL查询原理及其慢查询优化案例分享(转)
MySQL凭借着出色的性能.低廉的成本.丰富的资源,已经成为绝大多数互联网公司的首选关系型数据库.虽然性能出色,但所谓“好马配好鞍”,如何能够更 好的使用它,已经成为开发工程师的必修课,我们经常会从职 ...
- [OJ] Find Minimum in Rotated Sorted Array
LintCode 159. Find Minimum in Rotated Sorted Array (Medium) LeetCode 153. Find Minimum in Rotated So ...
- 一起啃PRML - 1.2.3 Bayesian probabilities 贝叶斯概率
一起啃PRML - 1.2.3 Bayesian probabilities 贝叶斯概率 @copyright 转载请注明出处 http://www.cnblogs.com/chxer/ 这一节简单讲 ...
- 如何区分Shapefile,Coverage,Geodatabase(转载)
转自:http://www.cnblogs.com/linhugh/archive/2012/04/06/2435266.html 在过去20年中,矢量数据模型是GIS中变化最大的方面,例如,ESRI ...
- Intersoft Mobile Studio 2013 R1 SP1 Crack
Intersoft Mobile Studio 2013 R1 SP1 (iOS, Android & WinR) Leave a comment tweet inShare ...
- BASH小脚本
1.查找当前目录中所有大于500M的文件,把这些文件名写到一个文本文件中,并统计其个数. find ./ -size +500M -type f | tee file_list | wc -l 2.在 ...
- HDOJ/HDU 1022 Train Problem I(模拟栈)
Problem Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot o ...