How to setup custom php.ini file?

What is php.ini?


PHP.ini is very important configuration file for PHP that is used to customize behavior of PHP at runtime.

This tutorial will show you how to setup your own php.ini file, explain some of the most commonly changed configuration settings, and how to modify those settings to your needs.


PHP Default settings:

The server is already configured with standard settings for PHP that have been selected by our administrators to be the most optimal setting for a majority of our customers. Unless you specifically need to change one or more of the settings, there is no need to create or modify a php.ini file. If the php.ini file does not exist in your account, then your site will use the default PHP settings defined on the server.


Customising php.ini file:

It is best if you have a copy of the custom php.ini file in your cPanel Home directory (/home/username/) and then make changes to that file.

Keep your custom php.ini file in location /home/username/php.ini  and then add below code to your primary .htaccess(/home/username/public_html/.htaccess)

 

suPHP_ConfigPath /home/username/php.ini

 

Be sure to replace "username" with your actual cPanel user name and don't forget to add php.ini file path to .htaccess file.

Note: You do not need multiple php.ini files in your folders. Keep only one custom php.ini file in /home/username/php.ini


Common php.ini settings for wordpress,joomla and other PHP applications:
 

The common settings are upload directory, register global variables, display errors, log errors, max uploading size setting, maximum time to execute a script and other configurations is written in this file.

upload_max_filesize = 10M
post_max_size = 10M
max_execution_time = 30
memory_limit = 64M
register_globals = Off
magic_quotes_gpc = Off
safe_mode = off

Please check Optimal PHP Settings on our servers.

 

NOTE: MisterCertified can not know why you would like to or need to change these settings. You are changing this at the advice of your web designer or the developer of your script. We can only show you where and how to make these changes. Please contact our support if you require further assistance.

Best wishes,

MisterCertified Support Team

¿Fue útil la respuesta?

 Imprimir éste Artículo

Leer también

Wordpress theme installation issue?

I recently installed a few new themes to my wordpress site and i can see the colors and fonts,...

Fatal PHP Memory Limit Error

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in...

Optimal PHP settings for shared and reseller hosting.

Note: We can't change following PHP settings. PHP has been configured to use the following...

HTTP Error 500 - Internal server error

If you installed a new script and are getting the 500 error trying to load the page please see...

Can you disable or turn off php Safe Mode?

No, we cannot disable php safe mode. All our servers have php safe mode enabled due to security...