We are aware of a potentially service impacting issue. Learn more

An Introduction to SuPHP Print

  • SuPHP, 500, Internal Server Error, 777, 755, php_value, php, php_flag, upload size, mod_rewrite
  • 0

Basic Introduction: What is it?

SuPHP is a module used for executing PHP scripts as their own user, rather than the apache user. It's therefore a much more secure environment that traditional mod_php or dso methods, however there are a few important points to note.

It does not allow files/folders to run where they have group and world write permissions; only the account owner can write to files/folders. This forces all users to ensure that their files/folders have correct permissions and prevents hackers uploading malicious content into vulnerable folders.

Error 500 Internal Server Error: How to fix?

Any files/folders which have group and world write permissions will result in an Error 500/internal server error. This is easily resolved by changing permissions. The highest permission SuPHP allows is 755.

Basically only the account owner can write to files/folders, not group or world.

PHP_Value flags dont work in .htaccess: How to fix?

SuPHP does not allow php_value flags in .htaccess

Instead of adding these directives to your .htaccess file, add them into a file called php.ini and place this file in the same directory that your script runs in. Most often this will be public_html directory, but in some cases you will install your script in a subdirectory. Wherever your script runs, this is the place for your php.ini file. You will need to drop the "php_flag" and "php_value" prefix. You will also need to put an equals (=) sign between the setting and the value.

For example, if your script recommends these settings in a .htaccess file:

php_value upload_max_filesize 10M
php_value post_max_size 10
php_value max_execution_time 60

Put these directives in a php.ini file instead. Here is the proper syntax:

upload_max_filesize = 10M
post_max_size = 10M
max_execution_time = 60

Things like redirects with mod_rewrite still work perfectly fine in .htaccess

If you are having any issues, please drop in a support ticket.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution