nginx+php5.6.12+discuz
2016-03-02 17:41
507 查看
#/usr/local/nginx/sbin/nginx-V
nginxversion:nginx/1.8.0
builtbygcc4.8.220140120(RedHat4.8.2-16)(GCC)
configurearguments:--with-openssl=../openssl-1.0.1m
php:
#php-v
PHP5.6.16(cli)(built:Nov26201507:52:51)
Copyright(c)1997-2015ThePHPGroup
ZendEnginev2.6.0,Copyright(c)1998-2015ZendTechnologies
withZendOPcachev7.0.6-dev,Copyright(c)1999-2015,byZendTechnologies
withXdebugv2.3.3,Copyright(c)2002-2015,byDerickRethans
备注:实际是php5.6.12原来用yum安装过5.6.16
主要是php的安装
配置环境:
一
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--enable-fpm--with-fpm-user=www--with-fpm-group=www--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-iconv-dir--with-freetype-dir=/usr/local/freetype--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl--enable-mbregex--enable-mbstring--with-mcrypt--enable-ftp--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--with-gettext--disable-fileinfo--enable-opcache
安装的过程报的错:
<1>configure:error:xml2-confignotfound.Pleasecheckyoulibxml2installation
解决:yuminstalllibxml2libxml2-devel
<2>configure:error:pleasereinstallthelibcurldistributioneasy.h....
解决:yuminstalllibcurlcurl-devel
<3>configure:error:jepglib.hnotfound
解决:yuminstalllibjpeglibjpeg-devel
<4>error:png.hnotfound
解决:yuminstalllibpnglibpng-devel
<5>freetype-confignotfound
解决:yuminstallfreetype-devel
<6>mcrypt.hnotfoundpleasereinstalllimcrypt
解决:yum安装limcrypt会失败下载libmcrypt-2.5.7.tar.gz编译安装
<7>error:Don'tkonwhowtodefinestructflockonthissystemset--enable-opcache=no
解决:编辑/etc/ld.so.conf(库文件)加入/usr/local/lib再执行ldconfig-v
注:网上有说法是64位操作系统用/usr/local/lib64结果试了不行
configure好了之后
make
makeinstall
二、
#pwd
/root/soft/php-5.6.12
#cpphp.ini-production/usr/local/php/etc/php.ini
#pwd
/root/soft/php-5.6.12/sapi
三、
source!$
[/code]
四、
[root@testfpm]#cpphp-fpm.conf/usr/local/php/etc/php-fpm.conf
[root@testfpm]#pwd
/root/soft/php-5.6.12/sapi/fpm
五、
[root@testfpm]#/usr/local/php/sbin/php-fpm-t
[01-Mar-201617:19:47]NOTICE:configurationfile/usr/local/php/etc/php-fpm.conftestissuccessful
六、
[root@rootfpm]#servicephp-fpmstart
Startingphp-fpm[01-Mar-201617:20:33]ERROR:[poolwww]cannotgetuidforuser'www'
[01-Mar-201617:20:33]ERROR:FPMinitializationfailed
failed
解决:useraddwww
七、
配置nginx
这里走了不少弯路
server{
listen3335;
server_namelocalhost;
indexindex.htmlindex.htmindex.php;
root/var/www;
location~\.php${
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/var/www$fastcgi_script_name;
includefastcgi_params;
}
}
八、
二级域名配置:
server{
listen80;
server_namebbs.xxx.com;
indexindex.htmlindex.htmindex.php;
root/var/www/html;
location~\.php${
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/var/www/html$fastcgi_script_name;
includefastcgi_params;
}
}
server{
listen80;
server_namebbs.yyyy.com;
indexindex.htmlindex.htmindex.php;
root/var/www/html;
location~\.php${
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/var/www/html$fastcgi_script_name;
includefastcgi_params;
}
}
nginxversion:nginx/1.8.0
builtbygcc4.8.220140120(RedHat4.8.2-16)(GCC)
configurearguments:--with-openssl=../openssl-1.0.1m
php:
#php-v
PHP5.6.16(cli)(built:Nov26201507:52:51)
Copyright(c)1997-2015ThePHPGroup
ZendEnginev2.6.0,Copyright(c)1998-2015ZendTechnologies
withZendOPcachev7.0.6-dev,Copyright(c)1999-2015,byZendTechnologies
withXdebugv2.3.3,Copyright(c)2002-2015,byDerickRethans
备注:实际是php5.6.12原来用yum安装过5.6.16
主要是php的安装
配置环境:
一
./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc--enable-fpm--with-fpm-user=www--with-fpm-group=www--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-iconv-dir--with-freetype-dir=/usr/local/freetype--with-jpeg-dir--with-png-dir--with-zlib--with-libxml-dir=/usr--enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl--enable-mbregex--enable-mbstring--with-mcrypt--enable-ftp--with-gd--enable-gd-native-ttf--with-openssl--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--with-gettext--disable-fileinfo--enable-opcache
安装的过程报的错:
<1>configure:error:xml2-confignotfound.Pleasecheckyoulibxml2installation
解决:yuminstalllibxml2libxml2-devel
<2>configure:error:pleasereinstallthelibcurldistributioneasy.h....
解决:yuminstalllibcurlcurl-devel
<3>configure:error:jepglib.hnotfound
解决:yuminstalllibjpeglibjpeg-devel
<4>error:png.hnotfound
解决:yuminstalllibpnglibpng-devel
<5>freetype-confignotfound
解决:yuminstallfreetype-devel
<6>mcrypt.hnotfoundpleasereinstalllimcrypt
解决:yum安装limcrypt会失败下载libmcrypt-2.5.7.tar.gz编译安装
<7>error:Don'tkonwhowtodefinestructflockonthissystemset--enable-opcache=no
解决:编辑/etc/ld.so.conf(库文件)加入/usr/local/lib再执行ldconfig-v
注:网上有说法是64位操作系统用/usr/local/lib64结果试了不行
configure好了之后
make
makeinstall
二、
#pwd
/root/soft/php-5.6.12
#cpphp.ini-production/usr/local/php/etc/php.ini
#pwd
/root/soft/php-5.6.12/sapi
cp
sapi/fpm/init
.d.php-fpm
/etc/init
.d
/php-fpm
chmod
755
/etc/init
.d
/php-fpm
三、
echo
"PATH=$PATH:/usr/local/php/bin:/usr/local/php/sbin"
>>
/etc/profile
#刷新系统环境
[/code]
[root@testfpm]#cpphp-fpm.conf/usr/local/php/etc/php-fpm.conf
[root@testfpm]#pwd
/root/soft/php-5.6.12/sapi/fpm
[root@testfpm]#/usr/local/php/sbin/php-fpm-t
[01-Mar-201617:19:47]NOTICE:configurationfile/usr/local/php/etc/php-fpm.conftestissuccessful
六、
[root@rootfpm]#servicephp-fpmstart
Startingphp-fpm[01-Mar-201617:20:33]ERROR:[poolwww]cannotgetuidforuser'www'
[01-Mar-201617:20:33]ERROR:FPMinitializationfailed
failed
解决:useraddwww
七、
配置nginx
这里走了不少弯路
server{
listen3335;
server_namelocalhost;
indexindex.htmlindex.htmindex.php;
root/var/www;
location~\.php${
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/var/www$fastcgi_script_name;
includefastcgi_params;
}
}
八、
二级域名配置:
server{
listen80;
server_namebbs.xxx.com;
indexindex.htmlindex.htmindex.php;
root/var/www/html;
location~\.php${
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/var/www/html$fastcgi_script_name;
includefastcgi_params;
}
}
server{
listen80;
server_namebbs.yyyy.com;
indexindex.htmlindex.htmindex.php;
root/var/www/html;
location~\.php${
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/var/www/html$fastcgi_script_name;
includefastcgi_params;
}
}
相关文章推荐
- 使用Nginx、Nginx Plus抵御DDOS攻击
- nginx下配置多站点
- Nginx支持比Apache高并发的原因
- Nginx中虚拟主机与指定访问路径的设置方法讲解
- Nginx Upstream Keepalive 分析
- Nginx的负载均衡
- OS X中多PHP环境与Nginx配置问题
- CDN调度器HAProxy、Nginx、Varnish
- redhat nginx 启动脚本
- Nginx 隐藏服务器名称和版本号
- Ubuntu下安装nginx常见问题及解决办法
- nginx 安装手记
- nginx 跳转指定接口
- 文章标题
- nginx+ffmpeg搭建rtmp转播rtsp流的flash服务器
- nginx命令:启动,停止及改变配置重启
- Nginx负载均衡配置
- Nginx基本配置、性能优化指南
- Nginx初始化过程总结
- nginx(二)