Change PHP Settings on cPanel Hosting

Use .user.ini to change values of your php settings, like max input vars, max execution time, and upload max filesize to higher limits on GoDaddy hosting
Fix memory exhausted error, and many other WordPress related errors by changing your php settings easily with this tutorial for GoDaddy shared hosting.
Share on facebook
Share on twitter
Share on linkedin
Share on pinterest

What are Php Settings?

If you are reading this, then you most likely wondering what exactly are php settings, and how exactly do you change these settings in cpanel? 

In this article, we will explain what PHP is, as well as explain what these php settings are.  We will show you where to adjust the values on your shared hosting plan, and will explain exactly How to adjust your php settings to the exact values you would like.   

It is actually quite common to have to change your php settings in cpanel, when you are using Content Management Systems like WordPress, Joomla, or Magento etc.

If you already have some knowledge of what php is, and what the php settings are, you can skip ahead.

So what exactly is PHP?  The site www.php.net defines php as ‘a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML’.  

What is PHP

To put that in context, php is a programming language that is widely recognized and is most popular for its use to build websites.

In fact, php is one of the most popular programming languages, due to the rising success of Content Management Systems (CMS) like WordPress, Drupal and Joomla.

Basically, php is the scripting language that WordPress runs off of.
Great, so my website runs off of the programing language PHP, but what are php settings?

PHP settings are a list of ‘directives‘ that are usually predefined by your hosting company.  These php settings are usually assigned a value, and can be changed to alter the behavior of certain plugins or themes when your website runs. 

Perhaps you are trying to import demo content, and are unable to without changing some of your php settings.  Plugins like Divi, Elementor, and WP Bakery normally recommend changes to some of the php settings like memory limit.

Here is a list of most common php settings, and I recommend changing all of them, depending on the task.

memory_limit
upload_max_filesize
post_max_size
max_execution_time
max_input_vars

How to change php settings in cpanel 

First, choose how you would like to change the PHP settings in cpanel.  The easiest method allows you to click a simple drop down, and select the value you would like to change that setting to.  These variables are predefined, which results in less overall control.  For example, this option does not include values like max input vars.  

I have broken this up into two sections, the first section for pure simplicity, and the second section for more advanced controls.

Change PHP settings in cpanel with the php editor:

1. Jump inside of cpanel.

If you are using a GoDaddy, get into cpanel by visiting ‘My Products’ and navigate to the ‘Web Hosting’ section.  You should see your cpanel hosting with the words ‘options’ and ‘Manage’ to the right.  Click on Manage.   Now click the ‘Cpanel Admin’ button on the upper right of your screen.   You will land on a page similar to the one below:

2.  Go to'Select PHP Version'

Believe it or not, cPanel has an entire section where you can change your php settings with a click of a button.  It is well hidden, and not clearly labeled, which is why the question of ‘How to change php settings in cpanel?‘ is so popular.  

Find the Software section of your cpanel.  It is normally the 4th or 5th section down.  There is a button called ‘Select PHP Version’.  Click on that.

3.  Switch to PHP Options

Once inside of ‘Select PHP Version’, you will notice all of the PHP Modules that are available in cPanel.  Ignore these, and locate the blue link ‘Switch to PHP Options’ in the upper right.  This may sometimes be labeled ‘Switch to PHP Settings’.  This link will actually take you to the page to change php settings in cpanel.

Inside of 'Select PHP Version', you will find all of your php extensions, including 'enable zip archiving', and the ability to change your php settings

4.  Change PHP Settings in cpanel

Finally, we have found the PHP settings in cPanel!  Notice all of the options you have to choose from.  You can find your max execution time, upload max filesize, post max size etc.   To change the values, you need to click on the actual value itself, and that will open up a dropdown box to select the custom value you would like to set it to!

Change PHP settings in cpanel with .ini file (recommended):

1.   Jump inside of cpanel. 

If you are using a GoDaddy, get into cpanel by visiting ‘My Products’ and navigate to the ‘Web Hosting’ section.  You should see your cpanel hosting with the words ‘options’ and ‘Manage’ to the right.  Click on Manage.   Now click the ‘Cpanel Admin’ button on the upper right of your screen.  

Your screen should look something like this:

2.  Find your websites folder in 'File Manager'

Click the File Manager icon under the ‘Files’ section.  Depending on where you are hosted, or when your cpanel was set up, the sections might be in a different order.

Inside of File Manager, navigate to Public_HTML.  If your site is the ‘Primary Domain‘ of your cpanel account, this is the folder you want to make changes in.   Otherwise, find the folder that your sites files are inside of, and jump into that one.

3.  Find or Create a file called '.user.ini'

First, we need to make this file visible.  Files like .htaccess, and .user.ini are going to be hidden by default. 

In the upper right corner inside of File Manager, click on ‘Settings’.  Make sure that ‘Show hidden files (dotfiles)’ is selected.   Click ‘Save’.  

Create .user.ini to edit your php settings like max_input_vars. See how to create and edit the file .user.ini

Next, in the upper left corner, above where it says ‘Collapse All’, locate the button that says ‘+File’.  This creates a new file.  Name the new file .user.ini as shown in the picture below.  Once you have it named, click the button ‘Create New File’.    

4. Input new php values into .user.ini file

memory_limit = 256M
upload_max_filesize = 256M
post_max_size = 256M
max_execution_time = 180
max_input_vars = 5000

After you make all the necessary change php settings in cpanel, simply click ‘Save Changes’ on the top right of the editor.  This will save the code you wrote, and the changes should take effect within 5 minutes.  The reason we use .user.ini, instead of php.ini, is because the changes take place much quicker, and can be used as a local value.  The same file is used in Godaddy’s Managed WordPress hosting as well.

If you want a way to check if the changes to your php settings went through, read the article ‘View  your PHP Settings with a PHP Info Page‘.

Use .user.ini to change values of your php settings, like max input vars, max execution time, and upload max filesize to higher limits on GoDaddy hosting

Like our content? Please follow us!

About The Author

Scroll to Top