- b2evolution CMS Support Forums
- b2evolution Support
- General Support
- question about how extra-path info is supposed to work
1 xangelusx Aug 18, 2006 22:59
My server is using IIS, with PHP called via fastCGI. It appears that this may cause problems using the extra-path info because of the way that PHP registers the PATH_INFO server variable under CGI (see [url=http://www.php.net/manual/ini.sect.path-directory.php#ini.cgi.fix_pathinfo]PHP Manual[/url]). Here's what phpinfo() shows when using extra-path info with the URL http://mysite.com/blogs/index.php/someblog/
_SERVER["PATH_INFO"] /someblog/
_SERVER["PATH_TRANSLATED"] C:/Inetpub/wwwroot/someblog/
_SERVER["SCRIPT_NAME"] /blogs/index.php
_SERVER["URL"] /blogs/index.php
_SERVER["ORIG_PATH_INFO"] /blogs/index.php/someblog/
_SERVER["ORIG_SCRIPT_NAME"] /blogs/index.php
_SERVER["SCRIPT_FILENAME"] C:\Inetpub\wwwroot\blogs\index.php
_SERVER["PHP_SELF"] /blogs/index.php
This translation causes the $ReqPath variable in b2evo to be valued as '/blogs/index.php', which then leads to the auto-detect portion of index.php (line 32) to not run since the extra-path info doesn't exist.
I can't change the value of cgi.fix_pathinfo in the PHP ini settings because it's a shared server and I don't know if any existing apps reply on it working this way. However, I don't mind hacking index.php to correct the problem at run time. My problem is that I don't know what the extra-path info should look like normally.
Can someone who is using extra-path info on an Apache server post the values of the server variables above using phpinfo on your index.php page? (Just be sure to remove any private path data)
Thanks!
Well, the fix appears to be relatively easy. In index.php change
to
It would be great if you could account for this in the core files. It seems safe to assume that if the ORIG_PATH_INFO server variable exists then the ReqPath needs to be adjusted.