|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们!装置php
[size=1em]yuminstallphp
yuminstallphp-mysqlphp-gdphp-imapphp-ldapphp-odbcphp-pearphp-xmlphp-xmlrpc
增加nginx默许主页index.php
vim/etc/nginx/conf.d/default.conf
location/{
root/usr/share/nginx/html;
indexindex.htmlindex.htmindex.php;
}
设置nginx撑持php
vim/etc/nginx/conf.d/default.conf
#passthePHPscriptstoFastCGIserverlisteningon127.0.0.1:9000
#
location~.php${
roothtml;
fastcgi_pass127.0.0.1:9000;
fastcgi_indexindex.php;
fastcgi_paramSCRIPT_FILENAME/usr/share/nginx/html$fastcgi_script_name;
includefastcgi_params;
}
设置php-fpm
vim/etc/php-fpm.d/www.conf
;Unixuser/groupofprocesses
;Note:Theuserismandatory.Ifthegroupisnotset,thedefaultusersgroup
;willbeused.
;RPM:apacheChoosedtobeabletoaccesssomedirashttpd
user=nginx
;RPM:Keepagroupallowedtowriteinlogdir.
group=nginx
chkconfigphp-fpmon#设置php-fpm自启动
chkconfigmysqldon#设置mysqld自启动
servicenginxrestart#从头启动nginx
servicephp-fpmstart#启动php-fpm
servicemysqldstart#启动mysqld
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的好朋友们! |
|