'ello all.
Is there a way to check if PHP is running via CGI at runtime?
What about if mod_rewrite is loaded? I trie get_loaded_extensions, but no dice.
TIA!
[man]php_sapi_name/man [man]apache_get_modules/man
Awesome. Thanks.
Interestingly, I am using PHP4.4.5 and I get an undefined apache_get_modules 🙁
Are you running in CGI mode? As per http://www.php.net/apache, "These functions are only available when running PHP as an Apache module."
Heh, so if you're on Apache and function_exists('apache_get_modules') returns false then you're running as a CGI - which is what the other function ought to return.
Weedpacket wrote:Heh, so if you're on Apache and function_exists('apache_get_modules') returns false then you're running as a CGI - which is what the other function ought to return.
Unless your sys-admin disabled the function for some twisted reason via the disable_functions directive in php.ini. 😉
I am the system admin and am running PHP via Apache.
There are no functions disabled.