欢迎来到天天文库
浏览记录
ID:21342343
大小:56.50 KB
页数:3页
时间:2018-10-21
《在zeus web server中安装php语言支持》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、在ZeusWebServer中安装PHP语言支持 前言 Zeus是一个运行于Unix下的非常优秀的ySQL、GD等。安装fastcgi 注意,如果你安装的PHP的版本会低于4.3.0哪么你才需要这步。新的PHP版本已经内置了fastcgi的库。安装fastcgi的方法非常的简单: root~$cd/usr/ports//fcgi/ root/usr/ports//fcgi$make;makeinstall;makeclean 编译完成后我们可以在/usr/local/lib目录中看到有libfcgi.a文件,同时在/usr/l
2、ocal/include目录中会有fastcgi的所有头文件。 编译PHP 编译PHP可以使用通常的PHP编译选项,下面是我使用的一个配置: ./configure--prefix=/usr/local/php--enable-fastcgi--ysql=/usr/local 需要注意的是在PHP4.3.0以上版本是使用的--enable-fastcgi选项,而PHP4.3.0以前的版本应使用--ake makeinstall 编译完成后,我们来测试一下安装的php是能正确运行: root~$cd/usr/local/php
3、/bin/ root/usr/local/php/bin$./php 这时将进入php代码输入状态,输入 <?phpinfo();?> 按ctrl-d运行后会见到php返回的信息则为正确。 配置FastCGI/PHP 配置FastCGI 进入Zeus管理控制台,打开需要配置的VHost配置。进入APISupport中的FastCGI设置。在其中设置: EnablingSupportforFastCGIPrograms:Enable 在ConfiguringFastCGIRemoteResponders中设置:
4、 Directoryname:/usr/local/php/bin/php Location:Machinename:localhost Additionalmethodssupported?:None 如果你的PHP应用不在本机,即使PHP没有安装在本机上,哪么也要设置Docrootpath参数,它可以不存在于相应的目录下。 都设置完成后,点击Apply按钮。配置PHP解析指向 进入URLHandling中的Handlers设置。在AddingaHandler中设置以下参数: FileExtension:php Spec
5、ifythepathandfilenameofthehandler,relativetotheumentroot:/usr/local/php/bin/php HTTP404errorsarehandledby:Thehandler 注意,这里的Specifythepathandfilenameofthehandler,relativetotheumentroot应和你上一步设置的Directoryname值相同。 都设置完成后,点击Apply按钮。 所有的设置完成后使用vhost的mit功能将更改提交并应用。这样Zeus就设置好
6、了Fastcgi和PHP的相关参数。 配置FastCGI/PHP启动 在Zeus的rc.d目录中新建一个S05php的文件,内容为:#!/bin/sh #ScripttostartandstopthepersistentPHPrunnerforFastCGI.#Pleasecheckpathsbeforeuse. #FastCGIPHPbinaryFPHPBIN=/usr/local/php/bin/php #LocationtoplacesemaphoreSEMFILE=/tmp/php.pidPHP_FCGI_CHILDRE
7、N=100PHP_FCGI_MAX_REQUESTS=1000exportPHP_FCGI_CHILDRENexportPHP_FCGI_MAX_REQUESTS #ThisisLinux-use/proctoincreasethelocal(ephemeral)portrange#echo102465000>/proc/sys/ipv4/ip_local_port_range if[-z$ZEUSHOME]then12下一页....,。cd`dirname$0`/..ZEUSHOME=`p$SEMFILEexit0fi;;
8、39;restart')if[-e$SEMFILE]thenechoStoppingFastCGIPHP.kill`cat$SEMFILE`sleep5fiechoStartingFa
此文档下载收益归作者所有