Configure WHM for suPHP
In the PHP 5 Handler menu, select suPHP and click Save Configuration.
Update permissions and ownership
To update file permissions and ownership, perform the following changes inside each user's public_html
directory:
- Change the permissions of files to
644
and directories to755
. -
Change the ownership of the files and directories within the
public_html
directory touser:user
.Warnings:
- Do not change the
public_html
directory owner. Thepublic_html
directory defaults to theuser:nobody
owner . - Do not make any changes to the directory itself.
- If you change ownership or permissions of files outside of the
public_html
directory, you may cause problems with other aspects of the account, such as mail.
- Do not change the
Edit the .htaccess files
If you previously allowed PHP customizations through .htaccess
files, you must remove or comment out all php_value
or php_flag
settings in the user .htaccess
files.
Warning:
We strongly recommend that you perform a backup before you make changes to your .htaccess
files.
Run the following commands to remove the php_value
and php_flag
settings from the .htaccess
files:
1
2
|
find /home -type f -name '.htaccess' - exec grep -Hrn 'php_value' '{}' \; find /home -type f -name '.htaccess' - exec grep -Hrn 'php_flag' '{}' \; |
PHP customizations
To allow PHP customization, create a custom php.ini
file in the user's directory.
To create a custom php.ini
file, perform the following steps:
- Copy the server's
/usr/local/lib/php.ini
to the user's home directory. -
Add the new values to the user's
php.ini
file.Warning:
If an invalid
php.ini
file resides in the user's directory, suPHP defaults to thephp.ini
file in the/usr/local/lib/
directory. - For each directory that contains PHP scripts that require the custom settings, add
suPHP_ConfigPath /home/username/
to the.htaccess
file in the folder that contains the PHP script.