How to create a custom php.ini file

There are some variables in the php.ini file that can be overwritten across all of our web hosting platform.  A common request is how to change the PHP file upload limit.

You can do this by creating a custom php.ini file in the directory you want the values set or in the public_html folder (the values will then be set for all files/folders).

Here is an example:

Use our on-line File Manager from your Hosting Control Panel or on your computer open a new document in Notepad, inside enter the command:

upload_max_filesize = 30M
post_max_size = 10M

This example shows the limit being set to 30MB for upload_max_filesize and 10MB for post_max_size.  You can change this to your required max file/post size.

Then save the file and name it php.ini and upload it to the directory where your scripts reside.

Uploading a PHP Info page to your hosting will then confirm these values are set.  This can be done with the following steps.

Use our on-line File Manager from your Hosting Control Panel or on your computer open a new document in Notepad, inside enter the command:

<?php
phpinfo();
?>

Then save the file and name it phpinfo.php (for example) and upload it to the directory where your scripts reside (within the public_html folder).  You can then navigate to this file via your web browser.

We would always advise deleting the PHP Info page once finished with for security reasons!

This entry was posted in Reseller Hosting, Web Hosting and tagged , , . Bookmark the permalink.