咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
1.首先要安装pcre
(1)yum install pcre
(2)或者下载源安装:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.10.tar.gz
#tar zxvf pcre2-10.10.tar.gz
#cd pcre2-10.10
#./configure
#make
#make install
2.再次安装zlib用于数据压缩
(1)yum install zlib
(2)或者下载源安装:wget http://www.landui.com/zlib-1.2.8.tar.gz
#tar -zxvf zlib-1.2.8.tar.gz
#cd zlib-1.2.8
#./configure --prefix=/usr/local/share/zlib 制定安装路径
#make 编译
#make install 安装
3.最后安装nginx,首先要下载更新nginx源
(1)安装nginx源:
rpm -ivh http://www.landui.com/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
yum install nginx
(2)或者手动输入:
touch /etc/yum.repos.d/nginx.repo
vi /etc/yum.repos.d/nginx.repo输入下面内容:
[nginx]
name=nginx repo
baseurl=http://www.landui.com/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1
保存后使之立即生效:yum makecache
安装:yum install nginx
默认安装路径:/etc/nginx
4.还没完,接下来安装php
(1)yum install php php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt
(2)如果要让nginx认识php那么要有中间人php-fpm的介绍:
yum install php-fpm
service php-fpm start
chkconfig php-fpm on
5.重启下nginx现在可以建立php站点了,注意在站点的配置文件中需要把
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;修改为:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;