Php – Am I running PHP or suPHP

apache-2.2PHPsuphp

I am testing to see if I am running PHP or suPHP. when I issue phpinfo()

I get back over 600 lines of data. The only mention of suPHP occurs here

<tr><td class="e">Loaded Modules </td><td class="v">core mod_log_config mod_logio prefork http_core mod_so mod_alias mod_auth_basic mod_authn_file mod_authz_default mod_authz_groupfile mod_authz_host mod_authz_user mod_autoindex mod_cgi mod_deflate mod_dir mod_env mod_mime mod_negotiation mod_php5 mod_reqtimeout mod_setenvif mod_status mod_suphp </td></tr>

I read on another site that Server API should be CGI not Apache in order to be running suPHP

I tried posting the full output but it is over 30,000 characters. If you think it is important, I can try putting half of it.


EDIT It seems I have suPHP partially working. If I load a script and issue getuserid() or get_current_user() it returns my user information, not www-data. However if I try to read/write to a file that doesn't have permission for everyone to read/write, it says failed to open stream: Permission denied. Any ideas what could be causing this?

Best Answer

That output shows you have both the DSO PHP module enabled as well as the SuPHP module, so which parser is running your scripts depends on your Apache configuration. Specifically, this is defined by the AddHandler directive. You can check your phpinfo() for the defined Server API and if it says CGI then based on the information you've provided, you're defaulting to SuPHP.