centos7.0 64位系统 安装PHP 支持 nginx
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(只支持nginx 不支持apache)
tar -jxvf php-5.3.27.tar.bz2
cd php-5.3.27
./configure --prefix=/usr/local/php5.3 --disable-debug --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-bz2 --with-mcrypt --enable-gd-native-ttf --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/php5.3/etc --enable-mbstring --with-gd --disable-debug --enable-short-tags --disable-posix --enable-exif --enable-ftp --enable-sockets --with-mhash --enable-zip make
make install
cp php.ini-production /usr/local/php5.3/etc/php.ini
设置 /usr/local/php/etc/php-fpm.conf 里面的内容 根据实际情况修改
vi /etc/init.d/php-fpm (内容可以根据实际情况修改)
#!/bin/bash
# chkconfig:
# description: php-fpm is a FastCGI web server.
# processname: php-fpm
# config: /usr/local/php/etc/php-fpm.conf
# pidfile: /var/run/php-fpm.pid
#=======================================================================================
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin BINFILE="/usr/local/php/sbin/php-fpm"
CFGFILE="/usr/local/php/etc/php-fpm.conf"
PIDFILE="/var/run/php-fpm.pid"
LOCKFILE="/var/lock/php-fpm.lock" RETVAL= start() {
[[ -x $BINFILE ]] || exit
[[ -f $CFGFILE ]] || exit if [[ `ps aux | grep php-fpm: | grep -v grep | wc -l` -gt ]]; then
echo "The php-fpm is already running."
return
fi $BINFILE -t >/dev/null >& if [[ $? -ne ]]; then
echo "The php-fpm configure has error."
return
fi echo -n "Starting php-fpm......"
$BINFILE -y $CFGFILE -g ${PIDFILE}
RETVAL=$?
echo
[[ $RETVAL -eq ]] && touch $LOCKFILE return $RETVAL
} stop() {
if [[ `ps aux | grep php-fpm: | grep -v grep | wc -l` -eq ]]; then
echo "The php-fpm is not running."
return
fi echo -n "Shutting down php-fpm......" if [[ -f $PIDFILE ]]; then
kill -QUIT `cat ${PIDFILE}`
else
kill -QUIT `ps aux | grep php-fpm | awk '/master/{print $2}'`
fi RETVAL=$?
echo
[[ $RETVAL -eq ]] && rm -f $LOCKFILE $PIDFILE return $RETVAL
} restart() {
stop
sleep while true
do
if [[ `ps aux | grep php-fpm: | grep -v grep | wc -l` -eq ]]; then
start
break
fi
sleep
done RETVAL=$?
echo return $RETVAL
} reload() {
if [[ `ps aux | grep php-fpm: | grep -v grep | wc -l` -eq ]]; then
echo "The php-fpm is not running."
return
fi echo -n $"Reloading php-fpm......" if [[ -f $PIDFILE ]]; then
kill -USR2 `cat ${PIDFILE}`
else
kill -USR2 `ps aux | grep php-fpm | awk '/master/{print $2}'`
fi RETVAL=$?
echo return $RETVAL
} case "$1" in
start)
start
;; stop)
stop
;; restart)
restart
;; reload)
reload
;; *)
echo "Usage: service php-fpm {start|stop|restart|reload}"
RETVAL=
esac exit $RETVAL
设置php-fpm开机启动
chmod /etc/init.d/php-fpm
chkconfig --add php-fpm
chkconfig php-fpm on
/etc/init.d/php-fpm start
接下来就是配置 nginx支持php文件的访问
centos7.0 64位系统 安装PHP 支持 nginx的更多相关文章
- centos7.0 64位系统 安装PHP5.3 支持 nginx
1 安装PHP所需要的扩展 yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel curl cur ...
- 解决虚拟机vmware安装64位系统“此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态”的问题
虚拟机使用的是VMware Workstation,并且首次在虚拟机体验64 位系统.在新建好虚拟机,运行时候就出现了VMware Workstation 的提醒:此主机支持 Intel VT-x,但 ...
- 解决虚拟机vmware虚拟机安装64位系统“此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态”的问题
前言 虚拟机使用的是VMware Workstation,并且首次在虚拟机体验64 位系统.在新建好虚拟机,运行时候就出现了VMware Workstation 的提醒:此主机支持 Intel VT- ...
- vmware安装64位系统“此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态”的问题
虚拟机使用的是VMware Workstation,并且首次在虚拟机体验64 位系统.在新建好虚拟机,运行时候就出现了VMware Workstation 的提醒:此主机支持 Intel VT-x,但 ...
- 64位系统 IIS不支持 Excel导入的问题
64位系统不支持读取excel的问题: 应用程序池-常规选项 启用32应用程序 启用23应用程序是为了保证32应用程序能够正常运行
- Ubuntu 16.04 LTS 64位系统 安装Docker
本文开发环境为Ubuntu 16.04 LTS 64位系统,通过apt的docker官方源安装最新的Docker CE(Community Edition),即Docker社区版,是开发人员和小型团队 ...
- 解决虚拟机安装64位系统“此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态”的问题
环境说明:系统:Windows 8.1 简体中文专业版 虚拟机:VMware Workstation 11.0.0 报错:此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态.如 ...
- 解决VMWARE 虚拟机安装64位系统“此主机支持 Intel VT-x,但 Intel VT-x 处于禁用状态
VMWARE WORKSTATION 在安装64为操作系统报错,报错内容如图: 错误提示已经很清楚了,需要在BIOS 中打开intel VT-x g功能,开启此功能的前提是: 1.首先要确定的就是你的 ...
- VMWARE虚拟机安装64位系统此主机支持IntelVTx 但IntelVTx处于禁用状态
1.进入BIOS(我的电脑是Thinkpad e480,进入按钮是F12/ Fn+F12) 2.选择App Menu,再选择第一项Setup,进入 3.选择Security,选择下面第四项Virtua ...
随机推荐
- JavaScript 设计模式之工厂模式
- objective-c第六章课后练习5
题5:用于翻转从终端输入数的各个位.然后修改这个程序,以便正确的输入负数. code: ,result_5 = ; NSLog(@"input num_5:"); scanf(&q ...
- HttpClient_002_中文乱码、HttpClient中文乱码透析、总结
中文乱码原理代码: String s = "中文"; byte[] bs2 = s.getBytes("utf-8");//将s拆成:utf-8个体,注:utf ...
- Unable to create SVNRepository object
I think you are missing at least the library setup stuff: /* * Initializes the library to w ...
- 关于block使用的5点注意事项
1.在使用block前需要对block指针做判空处理. 不判空直接使用,一旦指针为空直接产生崩溃. if (!self.isOnlyNet) { if (succBlock == NULL) { // ...
- HDU 4280:Island Transport(ISAP模板题)
http://acm.hdu.edu.cn/showproblem.php?pid=4280 题意:在最西边的点走到最东边的点最大容量. 思路:ISAP模板题,Dinic过不了. #include & ...
- LeetCode----8. String to Integer (atoi)(Java)
package myAtoi8; /* * Implement atoi to convert a string to an integer. Hint: Carefully consider all ...
- Wormholes
Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes ...
- ASP.net解析JSON例子
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- mac攻略(二) -- 简单配置php开发环境
最简单直接的方式还是使用 Mac 上自带的 Apache 和 PHP. 1.启动 Apache 1>启动apache $sudo apachectl start; 2>启动后,在浏览器 ...