PHP script execution mode not working

4 posts / 0 new
Last post
#1 Sun, 03/20/2011 - 04:47
tuaris

PHP script execution mode not working

On some sites, I have enabled the PHP script execution mode to use FCGId (run as virtual server owner).

  • Apache is properly configured (according to this message): suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
  • The Virtualmin Configuration has Automatically add appropriate SuExec directive set to Yes.
  • When running the Checking Configuration option, everything is OK.

When I run


<?php system('whoami'); ?>

In a test file, it still shows ww-data.

This is Ubuntu 10.04 with Virtualmin GPL.

Sun, 03/20/2011 - 10:57
andreychek

Howdy,

There was an issue with Ubuntu (that more recent installers handle) where if mod_php is enabled in Apache, it overrides CGI/FCGID.

If you look in /etc/apache2/mods-enabled/php5.conf -- do you see any "SetHandler" lines in there? If so, comment them out, and restart Apache -- that should do the trick for you!

-Eric

Sun, 03/20/2011 - 14:04
tuaris

Thank you, their are indeed some SetHandler lines in the conf file. If I remove those lines, what would the effect be on the existing websites that make use of mod_php? Will I need to go into each one (currently 100+) and manually add in those lines?

Sun, 03/20/2011 - 15:56
andreychek

Nope, it should continue to work for the other websites.

My recommendation would be to comment out those two lines, restart Apache, then test your other mod_php sites, just to make sure that works as expected. But it should work as needed.

-Eric

Topic locked