Using suPHP_ConfigPath in htaccess and php.ini Files

Using suPHP_ConfigPath in htaccess and php.ini Files

Single User PHP (SuPHP) is a type of PHP Handler that executes PHP scripts with the authorization of their owners. This Handler is installed on all the shared servers thus one can use this to set settings from the php.ini file global for the whole account. This file is available in public_html folder and if you want to enable it for the whole hosting account then you should add some configuration in the .htaccess file. More about the configuration adding process is detailed in the text ahead.

The Configuration That Should Be Added in .htaccess File is -:

Code:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/USER/public_html
</IfModule>
Note : Here “USER” means the cPanel Username. User can also load php.ini file from Subdirectories by using the ConfigPath accordingly.

Code:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/USER/public_html /subdirectory_name
</IfModule>
This tells mod_suphp the path which should be passed on to the PHP-interpreter & from which folder the php.ini file will be executed.

Instructions to Add The Configuration into .htaccess File :

1. From cpanel how to change the configure .htaccess file :
  • Go To cPanel >> click on "Files" under Files menu.
files.png

  • Here click on public_html Directory.
public.png

  • After reaching the Directory, click Settings and enable Show Hidden Files (dotfiles) so that you can find the .htaccess file, if you still can't find the .htaccess file then you should create it using file option.
hidden.png

  • If the .htaccess file is present or you have created it then you should select the file and then open the file in editable mode by clicking Edit (Placed at Toolbar) or Right Click the file name and then Click Edit.
  • Add the following configuration in .htaccess file & Save the Changes.
Code:
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/USER/public_html
</IfModule>
After doing all this process, the php.ini file designed and added by you will immediate take effect.
Author
bhawanisingh
Views
7,321
First release
Last update
Rating
0.00 star(s) 0 ratings
Top