nginx php 安装
2016-01-11 10:09
627 查看
一、安装nginx
1、在nginx官方网站下载一个包,下载地址是:http://nginx.org/en/download.html
2、WinSCP(ftp上传工具).exe FTP 上传工具上传达到CentOS中
3、我是先建一个目录,把要用的到的安装包放到一起.
#mkdir /home/
#tar zxf nginx-1.4.1.tar.gz
#cd nginx-1.4.1
4、安装pcre开发包
#yum install -y pcre-devel
5、如果安装出现在下面的错误是缺少编译环境。安装编译源码所需的工具和库
./configure: error: C compiler cc is not found
#yum install gcc gcc-c++ ncurses-devel perl
6、安装cmake,从http://www.cmake.org下载源码并编译安装
#yum -y install make gcc gcc-c++ ncurses-devel
#yum -y install zlib zlib-devel
7、如果需要ssl功能需要openssl库
#yum -y install openssl openssl--devel
8、安装nginx
#cd nginx-1.4.1
#./configure --prefix=/opt/nginx
#make
#make install
9、启动服务
#/opt/nginx/sbin/nginx -c /opt/nginx/conf/nginx.conf
10、停止服务
#/opt/nginx/sbin/nginx -s stop
11、查看端口占用情况
#netstat -tunlp
12、如果其它机器无法访问,解决方法如下:
#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
然后保存:
#/etc/rc.d/init.d/iptables save
重启防火墙
#/etc/init.d/iptables restart
安装php
./configure --prefix=/usr/local/php --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --with-openssl --enable-gd-native-ttf --enable-gd-jis-conv --with-gd --enable-ftp --with-curl --disable-rpath
1、在nginx官方网站下载一个包,下载地址是:http://nginx.org/en/download.html
2、WinSCP(ftp上传工具).exe FTP 上传工具上传达到CentOS中
3、我是先建一个目录,把要用的到的安装包放到一起.
#mkdir /home/
#tar zxf nginx-1.4.1.tar.gz
#cd nginx-1.4.1
4、安装pcre开发包
#yum install -y pcre-devel
5、如果安装出现在下面的错误是缺少编译环境。安装编译源码所需的工具和库
./configure: error: C compiler cc is not found
#yum install gcc gcc-c++ ncurses-devel perl
6、安装cmake,从http://www.cmake.org下载源码并编译安装
#yum -y install make gcc gcc-c++ ncurses-devel
#yum -y install zlib zlib-devel
7、如果需要ssl功能需要openssl库
#yum -y install openssl openssl--devel
8、安装nginx
#cd nginx-1.4.1
#./configure --prefix=/opt/nginx
#make
#make install
9、启动服务
#/opt/nginx/sbin/nginx -c /opt/nginx/conf/nginx.conf
10、停止服务
#/opt/nginx/sbin/nginx -s stop
11、查看端口占用情况
#netstat -tunlp
12、如果其它机器无法访问,解决方法如下:
#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
然后保存:
#/etc/rc.d/init.d/iptables save
重启防火墙
#/etc/init.d/iptables restart
安装php
./configure --prefix=/usr/local/php --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-fpm --with-openssl --enable-gd-native-ttf --enable-gd-jis-conv --with-gd --enable-ftp --with-curl --disable-rpath
相关文章推荐
- 一个关于if else容易迷惑的问题
- nginx代理指定目录
- PHP5.2.*防止Hash冲突拒绝服务攻击的Patch
- 深入理解PHP之匿名函数
- 访问Nginx发生SSL connection error的一种情况
- JSP/PHP基于Ajax的分页功能实现
- 关于PHP通过PDO用中文条件查询MySQL的问题。
- Nginx+Naxsi部署专业级Web应用防火墙
- 什么是设计模式
- CentOS 6.2实战部署Nginx+MySQL+PHP
- PHP数据库长连接mysql_pconnect的细节
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- Php Installing An Expansion
- Nginx 学习笔记(一)
- 网站502与504错误分析