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

Kas see vastus oli kasulik?

 Prindi artikkel

Loe veel

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...

What is suPHP ?

What is suPHP? (su = switch user, allowing one user to "switch" to another if authorised) The...

Wordpress theme installation issue?

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

My PHP program tells me it can't access the database and gives an error message ?

MySQL - When you create a new database you have to specify a database name. Then you create a...

Can't install another script in root directory? Why?

When using fantastico you cannot install more than one script in the root directory. If you...