参考:http://blog.csdn.net/ihelloworld/article/details/7029796

http://blog.chinaunix.net/uid-21374062-id-2951960.html
http://www.cnblogs.com/mchina/archive/2012/05/17/2507102.html
http://blog.sina.com.cn/s/blog_505bf9af010137gf.html

安装php:
yum install libxml2
yum install libxml2-devel -y
yum -y install freetype freetype-devel
yum -y install pcre*

1. 下载 php-5.2.13.tar.gz 和 php-5.2.13-fpm-0.5.13.diff.gz
2. 安装
# tar zxvf php-5.2.13.tar.gz
# gzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d php-5.2.13 -p1
# cd php-5.2.13
# ./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm --with-mysql=/usr/local/mysql
# make
# make install
# cp php.ini-dist /usr/local/lib/php.ini
启动php-cgi:
/usr/local/php/sbin/php-fpm start

1 安装nginx
#tar -zxvf nginx-0.8.33.tar.gz
#cd nginx-0.8.33
#./configure --prefix=/usr/local/nginx

(安装Nginx时报错
./configure: error: the HTTP rewrite module requires the PCRE library.
执行安装下面的yum
)

#yum -y install openssl openssl-devel
#yum -y install pcre-devel openssl openssl-devel

#./configure --prefix=/usr/local/nginx
#make
#make install

修改nginx.conf配置文件:
server {
listen 80;
server_name testlink.conversant.com.cn;
location / {
root /usr/local/nginx/html;
index index.php index.html index.htm;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/local/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
}

3
启动php-cgi:/usr/local/php/sbin/php-fpm start

(报错: (没有分组什么的...)
修改php-fpm.conf, 放开注释
<!-- <value name="user">nobody</value> -->
<!-- <value name="group">nobody</value> -->
)
4 启动nginx
/usr/local/nginx/sbin/nginx start
或者
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

5 关闭防火墙
1)永久性生效,重启后不会复原
开启: chkconfig iptables on 关闭: chkconfig iptables off
2)即时生效,重启后复原
开启: service iptables start 关闭: service iptables stop
3)查看防火墙状态
chkconfig iptables --list
[@more@]

linux下安装nginx+php的更多相关文章

  1. 【云服务器部署】---Linux下安装nginx

    [云服务器部署]---Linux下安装nginx 之前两篇,分别讲了:Linux下安装MySQL  和  springboot项目部署云服务器 nginx安装也是挺简单的.具体步骤如下: 第一步,下载 ...

  2. linux下安装nginx及初步认识

    linux下安装配置nginx nginx:是一个高性能的反向代理服务器正向代理代理的是客户端,反向代理代理的是服务端. 这里以nginx-1.12.2版本为例子 1.首先去官网下载nginx-1.1 ...

  3. linux 下 安装nginx及压力测试

    linux 编译安装nginx,配置自启动脚本 下载nginx: wget http://nginx.org/download/nginx-1.8.0.tar.gz下载openssl : wget h ...

  4. linux 下安装 nginx

    安装nginx版本为1.7.5 一.下载nginx 官方地址:http://www.nginx.org/ 下载地址:http://nginx.org/download/ Nginx官网提供了三个类型的 ...

  5. Linux下安装Nginx并配置一个图片服务器

    首先安装nginx安装环境 nginx是C语言开发,建议在linux上运行,本教程使用Centos6.5作为安装环境. gcc 安装nginx需要先将官网下载的源码进行编译,编译依赖gcc环境,如果没 ...

  6. linux下安装nginx和配置

    1.系统:centos6.8 2.安装准备: 安装nginx前,我们首先要确保系统安装了g++.gcc.openssl-devel.pcre-devel和zlib-devel软件,可通过如图所示命令进 ...

  7. linux下安装nginx+php+mysql环境 详细教程

    话不多说上代码 linux环境:centos 7.0 64位 nginx:nginx-1.8.0.tar.gz php: php-7.1.1.tar.gz mysql: mysql-5.6.21.ta ...

  8. Linux下安装Nginx服务器

    安装Nginx之前,首先要安装好编译环境gcc和g++,然后以CentOS为例安装Nginx,安装Nginx需要PRCE库.zlib库和ssl的支持,除了ssl外其他的我们都是去官网下载: Nginx ...

  9. Linux下安装Nginx详细图解教程

    什么是Nginx? Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器,在高连接并发的情况下N ...

  10. linux下安装nginx、pcre、zlib、openssl

    1.安装nginx之前需要安装PCRE库的安装  最新下载地址   ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ tar –zxvf p ...

随机推荐

  1. CCNA网络工程师学习进程(7)路由器的路由配置

        前面一节已经介绍了路由器的端口配置,接着我们介绍路由器的路由配置:静态路由.默认路由和浮动路由的配置:动态路由协议的配置,包括RIP.IGRP.EIGRP和OSPF.     (1)路由器的基 ...

  2. 再谈加密-RSA非对称加密的理解和使用

    html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,bi ...

  3. hdu1046

    #include<iostream> #include<cmath> using namespace std; int main() { int T,t=0,m,n; cin& ...

  4. JQuery基础知识(1)

    JQuery基础知识(1) 对JQuery学习中遇到的小细节进行了整理和总结 1.JQuery hide()和show()方法,分别对选中的元素进行隐藏和显示,语法:hide()和show分别有对应的 ...

  5. 在GNU/Linux下使用Lilypond排版简谱

    尽管GNU/Linux并非无所不能,但确实能在很多时候提供免费.开放的解决方案.这两天我想做一个简谱,在网上搜索乐谱排版软件,发现了基于GPL协议的Lilypond软件.只不过Lilypond是用来做 ...

  6. macos上安装wget命令

    首先从Apple Store下载Xcode,然后安装Xcode,接着安装Homebrew包管理,类似于Ubuntu下的apt-get: 终端下输入ruby -e "$(curl -fsSL ...

  7. sql第三天

    ->完整的select语句及执行顺序(必须记住) 5...select 5.2->distinct 7...top n [percent] 5.1->列名 聚合函数(1.2-> ...

  8. 【IE6的疯狂之九】li在IE中底部空行的BUG

    曾经写过[IE6的疯狂之六]li在IE中底部3像素的BUG(增加浮动解决问题),原文地址:http://www.css88.com/archives/421: IE6 BUG大全: http://ww ...

  9. TODO:字节序的一些理解

    TODO:字节序的一些理解 本文是小编对字节序的片面理解,希望对你有帮助哈. 字节序,即字节在电脑中存放时的序列与输入(输出)时的序列是先到的在前还是后到的在前. 1.Little endian:将低 ...

  10. mysql 时间

    显示当前时间: mysql> select now(); +---------------------+ | now() | +---------------------+ | -- :: | ...