Client Login

What is suPHP? What is being changed from phpsuexec to suPHP? How to use PHP 4 or PHP 5 on CleoHost shared servers?

suPHP is a tool for executing PHP scripts with the permissions of their owners. Phpsuexec also executes PHP with the permission of their owners. However, these are two different tools and there are some improvements with moving to suPHP now that phpsuexec has been deprecated.

Once suPHP is available on your server, you can login to your control panel and find a link 'PHP Configuration' under 'Software/Services'. On that page:

1. You can switch your account's PHP to PHP 4 or PHP 5.

2. You can read how to configure PHP and how suPHP works. It is similar to phpsuexec as explained on this link excluding some improvements mentioned below.

3. Download the server wide php.ini for PHP 4 or PHP 5 and customize it for your own needs. You may need to do this regularly to keep your PHP settings in synch with server level settings such as after a Zend Optimizer upgrade.

Changes from phpsuexec to suPHP:

1. By default, the PHP CLI is PHP 5. Here are the paths for your reference:

/usr/bin/php (PHP 5 CGI)
/usr/local/bin/php (PHP 5 CLI)
/usr/php4/bin/php (PHP 4 CGI)
/usr/local/php4/bin/php (PHP 4 CLI)

2. There are some significant improvements in suPHP such as:

  • HTTP based authentication auth works via PHP.
  • Symbolic links to PHP files also work.
  • Permissions of public_html does not need to be changed for using shared SSL with PHP 5.
  • Custom error pages will work with both PHP 4 and PHP 5.

3. ionCube PHP Loader will be available server wide along with Zend Optimizer. If you use a custom php.ini, you will need to update it by downloading it from your control panel so that the latest Zend Optimizer can load for your scripts as well.

4. If you are setting up custom PHP settings, the custom php.ini file will be required in a folder where the PHP script needs to execute. Or you can place php.ini anywhere and have this directive in public_html/.htaccess

suPHP_ConfigPath /home/username/php5-config

where username is your cPanel account username, and php5-config is just a folder name (you can name it anything) and it will pick php.ini from that folder. Yes, you can have php.ini outside of your webroot in suPHP. This is a new feature.

5. To activate PHP 5 on a subfolder or in your whole account, this directive was added in .htaccess in phpsuexec

AddHandler application/x-httpd-php5 .php .php3 .phtml

or a variant of it. Now this must be proceeded by the marker comment to block cpanel from changing your settings:

# Use PHP5 as default
AddHandler application/x-httpd-php5 .php .php3 .phtml

Or if you use control panel to activate PHP 5 (upgraded servers), then you do not need to manually add the above directive.

Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read