要用到一套使用了 Zend Guard 加密PHP系统,且运行环境是 PHP5.3,因此须要使用 Zend Guard Loader 扩展。php
Zend Guard Loader 扩展 Win 版只支持运行在 PHP5.3 以上的 nts 版上,但 Window 版的 Apache 貌似已经不支持nts版的PHP了,蛋疼。
shell
我用的是WampServer集成环境,因而就想到了把 Apache 换成 FastCGI 模式来跑 PHP5.3 nts 版,这样就能够使用Zend Guard Loader 扩展了。apache
一、下载 PHP5.3.28 ,解压到 F:/php5.3.28nts ,配置好 php.ini,也顺便把 Zend Guard Loader 扩展配置好。windows
二、下载 mod_fcgid-2.3.6-win32-x86.zip 解压 manual、modules 目录中的文件到 f:\wamp\bin\apache\apache2.2.22 对应目录里去。
app
三、打开 Apache 配置文件 F:\wamp\bin\apache\apache2.2.22\conf\httpd.conf ,用#号注释掉 LoadModule php5_module "F:/wamp/bin/php/php5.3.13/php5apache2_2.dll" ,并在下面一行加入 :ide
LoadModule fcgid_module modules/mod_fcgid.so
四、在 httpd.conf 配置文件的最后加入下面的配置:
加密
AddHandler fcgid-script .fcgi .php #php.ini的存放目录 FcgidInitialEnv PHPRC "F:/php5.3.28nts" # 设置PHP_FCGI_MAX_REQUESTS大于或等于FcgidMaxRequestsPerProcess,防止php-cgi进程在处理完全部请求前退出 FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000 #php-cgi每一个进程的最大请求数 FcgidMaxRequestsPerProcess 1000 #php-cgi最大的进程数 FcgidMaxProcesses 3 #最大执行时间 FcgidIOTimeout 120 FcgidIdleTimeout 120 #php-cgi的路径 FcgidWrapper "F:/php5.3.28nts/php-cgi.exe" .php AddType application/x-httpd-php .php
五、告诉 Apache 执行方式,修改配置以下:.net
<Directory “D:/Web”> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride None Order allow,deny Allow from all </Directory>
六、最后重启 Apache。code