Hi all,

I did a quick search in the bug tracker and the mailing list archives and didn't see anything.

It looks like SetEnv PHPRC and Apache CGI redirection are not compatible.

When Apache is configured as indicated at http://php.net/security.cgi-bin and as recommended at http://www.php.net/manual/en/configure.php#configure.enable-force-cgi-redirect, it appears that SetEnv PHPRC cannot be used to specify a php.ini.

SetEnv PHPRC works (and can be seen when tested with a traditional CGI script, say written in Perl) but when the request goes to PHP via the internal Apache redirect, the PHPRC environmental variable gets rewritten as REDIRECT_PHPRC. This is why the CGI SAPI checks for the existence of the environmental variable REDIRECT_STATUS if "--enable-force-cgi-redirect" is specified.

Would it be reasonable to patch php_ini.c to check REDIRECT_PHPRC if FORCE_CGI_REDIRECT is defined? This way both the SetEnv method and the shell wrapper exporting PHPRC will work.

I just discovered the problem today, and have only skimmed through the php_ini.c code. Doesn't look too difficult to add to the search_path, but the ini_filename would probably require some sort of policy decision (which has precedence if both PHPRC and REDIRECT_PHPRC exist -- I assume PHPRC would).

Curious about how others feel about this issue.


Thanks,


Tienshiao

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to