
时间:2015-06-28 00:00 来源:IT猫扑网|http://www.itmop.com/ 作者:网管联盟 我要评论(0)
由于目前Nginx还不支持直接运行PHP,但是Nginx支持FastCGI,可以用FastCGI模式运行PHP作为后端。Nginx不能像Lighttpd那样自动启动FastCGI,所以这里要借一下lighttpd的spawn-fcgi工具来启动PHP。
安装PHP
|
以下为引用的内容: sudo apt-get install php5 php5-cgi |
获得spawn-fcgi
下载lighttpd,解压,
|
以下为引用的内容: ./configure |
spawn-fcgi启动脚本
|
以下为引用的内容: #!/bin/sh # /etc/init.d/php-fastcgi: start php fastcgi set -e BINPATH=&/usr/bin/spawn-fcgi& CGIPATH=&/usr/bin/php-cgi& OPTS=&-f $CGIPATH -a $ADDR -p $PORT -C $CHILDS -P $PIDFILE -u $RUNUSER -g $RUNGROUP& do_start() { do_stop() { case &$1″ in exit 0 |
脚本保存到 /etc/init.d/php-fastcgi,然后添加到启动项中:
update-rc.d php-fastcgi start 89 2 3 4 5 。 stop 19 0 1 6 。
nginx的设置
修改站点的设置,使php传到后端处理
|
以下为引用的内容: location ~ .php$ |
关键词标签:Ubuntu,Debian,Nginx
相关阅读 使用Python配平化学方程式的方法 CentOS NTP服务器安装与配置 Windows Server服务器日常管理技巧 RedHat Linux DHCP服务器中继 明明白白你的Linux服务器——安全篇 linux服务器基本安全配置手册
热门文章
CentOS NTP服务器安装与配置
nginx搭建flv流媒体服务器
CentOS 5.4+OpenVZ+Vtonf自建VPS服务器
DHCP服务器数据库移植的三个步骤
备份还原DHCP服务器配置的具体操作
Windows 2003下配置架设NTP时间服务器
人气排行 VMware中Shared Folders(共享文件夹)的配置 CentOS NTP服务器安装与配置 nginx搭建flv流媒体服务器 Windows 2003下配置架设NTP时间服务器 详细!解决WSUS服务器更新问题(附官方链接) heartbeat+LVS-ipvsadm+ldirectord搭建lvs DR集群 nginx的自动启动脚本 使用Python配平化学方程式的方法 linux服务器基本安全配置手册 DHCP服务器的授权问题 Ubuntu/Debian下简易Nginx+FastCGI+PHP配置 在Debian Linux系统下搭建DHCP服务器
查看所有0条评论>>