Quick Way To Test SuPHP?

  • Azoundria
  • Professor
  • Professor
  • User avatar
  • Joined: Jan 27, 2005
  • Posts: 907
  • Loc: Calgary, Alberta, Canada
  • Status: Offline

Post October 22nd, 2009, 5:23 pm

Hi All,

So I HAVE searched Google for this, and it should be very easy.

All I want to be able to do is build a PHP file that tests if SuPHP is enabled on a server. I've searched the entirity of PHP.net for SuPHP, and so I'm sure there's no easy function there. And then I looked all over the PHPInfo configurations of servers with and without SuPHP, and no luck there.

So, does anyone know, how I can find out if a server is running with SuPHP, or not? I'd prefer a solution which doesn't involve creating a test file of 777 permissions, or a new directory with a htaccess that has PHP directives, if possible. I'd like to just upload and view a PHP script to get the answer.

Thanks for your help.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post October 22nd, 2009, 5:23 pm

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8925
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post October 26th, 2009, 1:33 pm

If you can use phpinfo() I would create a php file with the following contents:

PHP Code: [ Select ]
<? phpinfo() ?>


Then browse everything and look where it says Server API. I believe if it the value says Apache then its not running PHP using suPHP. If it says CGI then I believe it is running suPHP.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8925
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post October 26th, 2009, 1:40 pm

Okay I just confirmed for you on some servers I run. On a server that is running suPHP for the Server API line it says:

CGI

For a server I run that is not using suPHP it says:

Apache 2.0 Handler
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post October 26th, 2009, 5:45 pm

I think it's possible to have it installed when PHP is installed as an Apache module too.

I've got a Ubuntu system here next to me that has PHP5 installed as an Apache2 module, in the "Loaded Modules" section of the "Apache2handler" section of phpinfo(), there is a "mod_suphp" listed, though I just now executed

Code: [ Select ]
sudo apt-get install libapache2-mod-suphp


so I can't tell you if it's working properly or not. The marker is there though.
Strong with this one, the sudo is.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 109 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.