How to change PHP settings with a php.ini: Difference between revisions

From Acenet Knowledgebase
Jump to navigation Jump to search
test
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
<html> This article shows you how to customize the php configuration using a php.ini file to modify php configurations for your script.  
#REDIRECT [[PHP Configuration - php.ini#Cloud]]
You can change any of the PHP settings that are configured on the server by using a custom php.ini file. All you need to do is create a text document entitled:  
 
php.ini<br /><br />Within this text document, specify the setting(s) you're wanting to change on separate lines. Here are some examples of PHP settings that you can change:  
This article shows you how to customize the php configuration using a php.ini file to modify php configurations for your script. You can change any of the PHP settings that are configured on the server by using a custom php.ini file. All you need to do is create a text document entitled:  
<div class="code_style">register_globals = Off<br />memory_limit = 64M</div>
 
<br />You will then need to set the permissions of the file to '755' and place it within the executing script's directory (the same directory that your script is located that requires this setting) because php.ini files are not recursive. If you're wanting to make your custom php.ini file recursive, in which it will affect all of your account's web accessible directories, you can view details on how to do so here:
<pre>php.ini</pre>
<a title="How can I create a recursive php.ini file?" href="https://esupport.acenet-inc.net/index.php?/Knowledgebase/Article/View/197/0/how-can-i-create-a-recursive-phpini-file">How can I create a recursive php.ini file?</a>
 
  <em>Note - you will want to be careful when using a recursive php.ini file though because it will affect all of the scripts installed within your account. A recursive php.ini file may even cause some of your scripts to break if they need settings configured differently than what you have specified in your recursive php.ini file.</em>
Within this text document, specify the setting(s) you're wanting to change on separate lines. Here are some examples of PHP settings that you can change:  
<strong>--Additional Information--</strong>
 
You can verify that the settings you specified have taken effect by creating a text document entitled:  
<syntaxhighlight lang="bash">register_globals = Off
phpinfo.php  
memory_limit = 64M</syntaxhighlight>
with the following specified within it:  
 
<div class="code_style"><? phpinfo(); ?></div>
You will then need to set the permissions of the file to '755' and place it within the executing script's directory (the same directory that your script is located that requires this setting) because php.ini files are not recursive. If you're wanting to make your custom php.ini file recursive, in which it will affect all of your account's web accessible directories, you can view details on how to do so here:
You will then upload the 'phpinfo.php' file to the same directory you uploaded the 'php.ini' file to and view the 'phpinfo.php' file in your internet browser. </html> [[Category:PHP]]
 
[[How to make a php.ini file apply to all subdirectories]]
   
{{note|You will want to be careful when using a recursive php.ini file though because it will affect all of the scripts installed within your account. A recursive php.ini file may even cause some of your scripts to break if they need settings configured differently than what you have specified in your recursive php.ini file.}}
 
You can verify that the settings you specified have taken effect by creating a text document entitled:  
 
<pre>phpinfo.php</pre>
 
with the following specified within it:  
 
<syntaxhighlight lang="bash"><? phpinfo(); ?></syntaxhighlight>
 
You will then upload the 'phpinfo.php' file to the same directory you uploaded the 'php.ini' file to and view the 'phpinfo.php' file in your internet browser.
 
[[Category:PHP]]

Latest revision as of 13:10, 6 January 2016

This article shows you how to customize the php configuration using a php.ini file to modify php configurations for your script. You can change any of the PHP settings that are configured on the server by using a custom php.ini file. All you need to do is create a text document entitled:

php.ini

Within this text document, specify the setting(s) you're wanting to change on separate lines. Here are some examples of PHP settings that you can change:

<syntaxhighlight lang="bash">register_globals = Off memory_limit = 64M</syntaxhighlight>

You will then need to set the permissions of the file to '755' and place it within the executing script's directory (the same directory that your script is located that requires this setting) because php.ini files are not recursive. If you're wanting to make your custom php.ini file recursive, in which it will affect all of your account's web accessible directories, you can view details on how to do so here:

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

You will want to be careful when using a recursive php.ini file though because it will affect all of the scripts installed within your account. A recursive php.ini file may even cause some of your scripts to break if they need settings configured differently than what you have specified in your recursive php.ini file.

You can verify that the settings you specified have taken effect by creating a text document entitled:

phpinfo.php

with the following specified within it:

<syntaxhighlight lang="bash"><? phpinfo(); ?></syntaxhighlight>

You will then upload the 'phpinfo.php' file to the same directory you uploaded the 'php.ini' file to and view the 'phpinfo.php' file in your internet browser.