How to make a php.ini file apply to all subdirectories: Difference between revisions

From Acenet Knowledgebase
Jump to navigation Jump to search
test
 
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
<html> Add the following code to the .htaccess file within your account's public_html folder (if one does not already exist, create one):  
#REDIRECT [[PHP Configuration - php.ini#Recursive]]
<div class="code_style"><IfModule mod_suphp.c><br />suPHP_ConfigPath /home/USERNAME/PATH/TO/INI/<br /></IfModule></div>
 
<br /><em>(replacing '/home/USERNAME/PATH/TO/INI/' with the appropriate path to your custom php.ini file)</em><br /><br />Properly configured example:<br /><br />
Add the following code to the .htaccess file within your account's public_html folder (if one does not already exist, create one):  
<div class="code_style"><IfModule mod_suphp.c><br />suPHP_ConfigPath /home/example/public_html/shop/php.ini<br /></IfModule></div>
 
<br />In the above example, the custom php.ini file is located at:<br /><br />/home/example/public_html/shop/php.ini
<syntaxhighlight lang="bash">
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.  
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/USERNAME/PATH/TO/INI/
</IfModule>
</syntaxhighlight>
 
(replacing '/home/USERNAME/PATH/TO/INI/' with the appropriate path to your custom php.ini file)
 
Properly configured example:
 
<syntaxhighlight lang="bash">
<IfModule mod_suphp.c>
suPHP_ConfigPath /home/example/public_html/shop/
</IfModule>
</syntaxhighlight>
 
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:  
Related articles:  
<a title="How can I change PHP settings?" href="https://esupport.acenet-inc.net/index.php?/Knowledgebase/Article/View/195/0/how-can-i-change-php-settings">How can I change PHP settings?</a> </html> [[Category:PHP]]
 
[[How to change PHP settings with a php.ini]]
 
[[Category:PHP]]

Latest revision as of 13:57, 6 January 2016

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

<syntaxhighlight lang="bash"> <IfModule mod_suphp.c> suPHP_ConfigPath /home/USERNAME/PATH/TO/INI/ </IfModule> </syntaxhighlight>

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

Properly configured example:

<syntaxhighlight lang="bash"> <IfModule mod_suphp.c> suPHP_ConfigPath /home/example/public_html/shop/ </IfModule> </syntaxhighlight>

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