PHP $_SERVER['SCRIPT_NAME'] is wrong when loading PHP via mod_fcgid

醉酒当歌 提交于 2019-12-01 10:56:52

Now I know what's wrong:

FcgidFixPathinfo 1

Set this value to 0. You can also comment it out, or remove it altogether, since 0 is the default.


According to the documentation:

This directive enables special SCRIPT_NAME processing which allows PHP to provide additional path information. The setting of FcgidFixPathinfo should mirror the cgi.fix_pathinfo setting in php.ini.

However I found that the value of cgi.fix_pathinfo in the php.ini file makes absolutely no influence as to the value of $_SERVER['SCRIPT_NAME']:

  • When FcgidFixPathinfo is set to 0 in the httpd.conf file, $_SERVER['SCRIPT_NAME'] is correct (/test.php), regardless of the value of cgi.fix_pathinfo in the php.ini file.

  • When FcgidFixPathinfo is set to 1 in the httpd.conf file, $_SERVER['SCRIPT_NAME'] is incorrect (C:/test.php), regardless of the value of cgi.fix_pathinfo in the php.ini file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!