Webmail Login
Control Panel Login
How to create a custom php.ini file (Linux server)
.CO.UK ONLY £5.33
Find your perfect domain here

How to create a custom php.ini file (Linux server)

Custom php.ini Guide

A php.ini file is a configuration file on your hosting that allows you to make changes to your PHP settings. These changes could be anything from increasing the maximum upload file size to altering the max execution time. Below we will list the most popular changes we see on the php.ini files on Squirrel Hosting and a quick guide on how to create a php.ini file.

How to create a custom php.ini file (Linux server)

To create a custom php.ini file you simply need to open up a plain text editor on your computer and save the file as php.ini. Below we will create one on a windows machine using notepad. (for a mac, use TextEdit).

Open up notepad and type what variables you would like to add (see below for most popular variables). In this example we will set the maximum upload filesize. Simply type the following;

upload_max_filesize = 64M

into notepad then click File > Save As...

Custom php.ini file

In the filename box type


Then from the dropdown box choose All files.

Save php.ini file

That's it, you have now made a custom php.ini file. The next step is to upload it. You will need to upload it to a specific folder/place on your hosting which varies depending on your chosen provider (usually the first public accessable folder). Squirrel Hosting customers simply need to upload the file to their public_html folder (if you need help doing this please contact support).

Top 4 custom php.ini variables

Below is a list of the top 4 most used variables on our servers and what they do. Please note that although there is no limit to the variable amount with Squirrel Hosting, many other companies have a max figure.

1) memory_limit =

PHP has a memory limit set by default of which it will allocate to the task provided. If this limit is lower than the amount needed it will produce an error like "Fatal error: Allowed memory size of [xxx] bytes exhausted", where [xxx] is the memory limit e.g. 8388608 which is 8MB (8388608 bytes).

To get around this we need to allocate more memory. To do this we add:

memory_limit = xxM

You can change the 'xxM' to the required figure e.g. '128M' which would mean 128Megabytes.

2) upload_max_filesize =

This controls the maximum size of a file that can be uploaded via php. To increase this we put;

upload_max_filesize = xxM

Again change the 'xxM' to the required figure e.g. '64M'.

3) max_execution_time =

This is the maximum time a script is allowed to run. (This includes database queries).

max_execution_time = 30 seconds

Change the '30 seconds' to the required figure e.g. '120 seconds' for 2 minutes.

4) max_input_time =

This controls how long should be allowed to collect data fromPOST and GET.

max_input_time = 60

Change the '60' to the required figure e.g. '120 seconds' for 2 minutes.

Has the above guide helped you? If so please click the social share buttons at the top of our page to share this with others.

Leave a comment

Has this guide helped you? Have an idea for a guide or need help? Let us know below.

© Copyright 2014 | Squirrel Hosting Limited
Company Number 9031308