How to make a php.ini file apply to all subdirectories

Add the following code to the .htaccess file within your account's public_html folder (if one does not already exist, create one):

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/USERNAME/PATH/TO/INI/
</IfModule>

(replacing '/home/USERNAME/PATH/TO/INI/' with the appropriate path to your custom php.ini file)

Properly configured example:

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/example/public_html/shop/
</IfModule>

In the above example, the custom php.ini file is located at:

/home/example/public_html/shop/php.ini

and that php.ini file is now recursive which means it will effect all of the web accessible directories within the account and not just the directory it's located in.

Related articles:

How to change PHP settings with a php.ini

  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

How to clear your internet browser's cache

Each internet browser has its own way to clear its cache. There are instructions below on how to...

Securing your Wordpress blog against Hacking

Security is a growing concern with all of the hackers and script kiddies waiting to do bad things...

IPhone or iPad - Setting Up an Email Account

General Configuration [1] Tap the icon (Settings) to begin. [2] Tap 'Mail, Contacts,...

Converting a cPanel account into an addon domain under another cPanel account

One thing to consider before you proceed with converting a stand-alone cPanel account into an...

How to Install and Use wget

wget is a non-interactive downloader. Using wget, you can download files directly to your server...