您的位置:首页 > 运维架构 > Nginx

centos65安装nginx和php

2015-09-08 00:00 711 查看
摘要: centos65安装nginx和php

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

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: