码迷,mamicode.com
首页 > Web开发 > 详细

centos65安装nginx和php

时间:2015-09-08 20:28:42      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:

 

yum -y install gcc automake autoconf libtool make cmake

yum -y install gcc gcc-c++ glibc glibc-devel
yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel

tar -xvzf php-5.6.13.tar.gz
cd php-5.6.13

./configure --prefix=/usr/local/php  --enable-fpm --with-mcrypt --enable-mbstring --disable-pdo --with-curl --disable-debug  --disable-rpath --enable-inline-optimization --with-bz2  --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli --with-gd --with-jpeg-dir
make
make test
make install
cd /usr/local/php/
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf
vim php-fpm.conf
运行php-fpm
/usr/local/php/sbin/php-fpm即可

cd
tar -xvzf pcre-8.36.tar.gz
tar -xvzf openssl-1.0.2a.tar.gz
tar -xvzf zlib-1.2.8.tar.gz
tar nginx-1.9.0.tar.gz
cd nginx-1.9.0
./configure  --prefix=/usr/local/nginx  --with-stream  --with-stream_ssl_module  --with-pcre=/root/pcre-8.36  --with-zlib=/root/zlib-1.2.8  --with-openssl=/root/openssl-1.0.2a  --with-http_ssl_module --with-http_sub_module  --with-http_realip_module  --with-http_stub_status_module --with-http_sub_module

在/usr/local/nginx/conf/nginx.conf
 location ~ \.php$ {
            root html;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }

在/usr/local/nginx/html/下新建t.php
cat t.php
<?php
    phpinfo();
?>

http://192.168.11.110/t.php

 技术分享

 

centos65安装nginx和php

标签:

原文地址:http://my.oschina.net/lenglingx/blog/502907

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!