`
lonestone
  • 浏览: 90672 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

经验和修正:关于Fleaphp运行于apache2+worker+fcgid

阅读更多

一直不是很满意apache2的prefork模式对内存的占用,感觉速度也慢了点,另外php很多模块都不是线程安全的,所以采用fastcgi来运行php,,我认为比较好 但是apache2自己的fastcgid却有很多问题,还好国人编写了fcgid这个二进制兼容模块 在Ubuntu server 8.04 linux下配置好apache2+worker+fcgid+php5后,无奈Fleaphp的URL_REWRITE模式总是有问题,报错: No input file specified. 确定 /etc/php5/cgi/php.ini中的 cgi.fixpath_info是设置为1的 看了fcgid的文档,说需要设置 PHP_Fix_Pathinfo_Enable 1 但依然不起作用 后来测试发现,是由于apache2的url_rewrite模块指令问题,在mod_php5下,我们用这个规则: 这样就没有问题,但是在fastcgi模式下,这么写,就会出现 No input file specified. 经检查发现 PATH_INFO 环境变量都是空的 后来查阅apache2的文档,发现rewrite模块的一个设置,看到了曙光: 'env|E=VAR:VAL' (set environment variable) This forces an environment variable named VAR to be set to the value VAL, where VAL can contain regexp backreferences $N和%N which will be expanded. You can use this flag more than once to set more than one variable. The variables can be later dereferenced in many situations, but usually from within XSSI (via <!--#echo var="VAR"-->) or CGI (例如, $ENV{'VAR'}). Additionally you can dereference it in a following RewriteCond pattern via %{ENV:VAR}. Use this to strip but remember information from URLs. 于是修改重写规则为: 然后修改FLEA/Filter/Uri.php中的第29-32行为: 这样就可以了,很郁闷吧,这个 'REDIRECT_PATH_INFO' google一下,居然没有什么记录! 分享下成功吧!

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics