Php max input vars bluehost

This is how to increase your PHP max time limit and max input vars with Bluehost. I am sure that the process is very similar with other hosting platforms.

  1. Login to your hosting provider (BlueHost)
  2. Click “Advanced” on the right hand bar
  3. Find the Software dropdown and click Multi PHP INI Editor
  4. Select the location of your website
  5. Change max_execution_time to 180
  6. Change max_input_vars to 5000
  7. Scroll down and click “Apply”
  8. You’re done!

I hope you enjoyed this short tutorial, if you like this content and want to see more on your feed – subscribe to my channel Puzzles Pro Tips on YouTube. Thanks.

PHP is server side scripting language which is the backbone of WordPress websites. WordPress core, themes and plugins contain PHP files that help you to get content from the database and assemble the page layout. However, the entire process of running any PHP script is to be completed within a limited time (generally in seconds). In order to control the script running time, PHP has a variable called max_execution_time. It is essential to setup this parameter to desired value to protect your server and allocate the server resources to real users visiting the site instead of running a poorly written script in the background.

WordPress SEO: Optimize WordPress site with free WordPress SEO guide.

Why Execution Time is Limited?

On most hosting servers, the default execution time is set as 30 seconds. However, some shared hosting companies may restrict to lower values. There are good reasons for restricting the maximum PHP execution time on WordPress.

  • Many hackers inject PHP files to run a script on your site. Restricting the script running time will help you to harden the security of your site.
  • Some legitimate scripts like broken link checker plugins will run the script to scan all pages on your site. This may work well for the sites with 100 pages. However, running a script on a site with 10K posts will bring the server down.
  • Old and poorly written PHP scripts can run long time and cause fatal errors.

Restricting maximum PHP execution time in server can help to stop these scripts running too long and affects real users on the site.

Why You May Need to Increase?

Though there are good reasons to limit PHP execution time on WordPress sites, there are also reasons why you should increase the limit.

  • Sometime updating WordPress core, theme or plugins need large amount of data to be downloaded. You can setup the maximum file upload size with post_max_size parameter. However, the PHP script should also run for long time in order for the upload to complete on your server. Otherwise, you will get update failed error due to timeout.

Php max input vars bluehost
Theme Update Error with PHP Execution Time Out

  • Many commercial WordPress themes offer custom demo import with large content. You may need to increase max_input_vars and max_execution_time parameter values in order to complete demo importing process. In addition, you may also need to increase maximum PHP memory size for the heavy plugins and themes to work properly.

How to View Max Execution Time?

Some hosting companies like Bluehost and SiteGround offers PHP Manager app in your account. You can use this app to find the max_execution_time setup for your site. For example, follow the below instructions in SiteGround hosting.

  • Login to your hosting account and go to “Websites” section.
  • Click on “Site Tools” link against the site you want to check the value.
  • Find PHP Manager app under “Devs” section or use the search option to find the app.
  • Go to “PHP Variables” section and scroll dow.
  • Locate max_execution_time variable to find the default value assigned to it.
  • SiteGround hosting allows 120 seconds as a default value which should be sufficient in most cases.
  • In addition, you can’t modify this value from this app.

Php max input vars bluehost
Change PHP Max Execution Time in SiteGround

On Bluehost hosting, you can use MultiPHP INI Editor app to find the max execution time value. If you are not able to find the default value, the best option is to ask your host to check for you.

How to Increase PHP max_execution_time in WordPress?

If you are receiving error like timeout, you can increase PHP max_execution_time to resolve the issue. You can do that using one of the following methods:

  1. Editing wp-config.php File
  2. Adding htaccess Directive
  3. Using php.ini File
  4. Using custom apps from server (for Bluehost)

For first three options, you have to edit configuration files using File Manager app from your hosting account. Alternatively, you can use FTP to access your site remotely and modify the file’s content.

Important: It is a good idea to backup the original files before you editing.

1. Increase PHP Execution Time with wp-config.php

Go to your WordPress root installation and find wp-config.php file. Below is an example screenshot of locating the file from File Manager app.

Php max input vars bluehost

Instead of File Manager, you can also use FTP account to modify wp-config.php file.

Php max input vars bluehost

Add the below line before it says /* That’s all, stop editing! Happy blogging. */. 100 in this example indicates the maximum execution time of 100 seconds, you can change to any desired value for your need.

/** Change PHP Max Execution Time */
set_time_limit(100);

It should look like below:

Php max input vars bluehost
Change PHP Max Execution Time in WP Config File

2. Increase PHP Execution Time with htaccess

Instead of editing wp-config file, you can add the below directive in htaccess file on your server root.

php_value max_execution_time 100

Note: .htaccess file is hidden by default. You have to enable viewing hidden files in FTP client to view this file. In most cases, File Manager will show all files without hiding.

3. Increase PHP Execution Time with php.ini

The last and preferred option is to use php.ini file.

  • Go to your server’s root and check whether you have php.ini file available. If the file is available, edit and add the below code.
max_execution_time = 100
  • If the file is not available, you can create a php.ini file using plain text editors like Notepad++ or Brackets. Add the above code in the file and upload on your server’s root.

Php max input vars bluehost
Increase PHP Max Execution Time in php.ini File

4. Using Custom Server Apps

This option is available only on certain hosting companies like Bluehost. We explain here with Bluehost, you have to confirm the availability of this type of apps with your hosting company.

  • Login to your Bluehost account and click on the “Advanced” section.
  • This will take you to cPanel.
  • Search and open MultiPHP INI Editor app.
  • Choose the domain you want to change the limit.
  • Scroll down to find max_execution_time PHP directive and change the value.
  • Click “Apply” button at the bottom to save your changes.
  • Bluehost sets the default value for max execution time as 30 seconds and limits the maximum value of 90 seconds.

Php max input vars bluehost
Change PHP Max Execution Time in Bluehost

Risks in Increasing Execution Time

Setting the value too high like 1000 seconds may potentially damage your server if there is a script running for such a long time. In addition, hackers or malicious scripts can run long time without termination affecting your site’s performance on the frontend. In order to protect the server, many hosts do not allow you to modify max_execution_time value more than the allowed limit.

Even you define the values using one of the above methods, it may not work if your host does not allow. The best option is to consult with your host and ask for help if you are struck with errors like update failed due to timeout.

How do I increase PHP max input variables in Bluehost?

Using an FTP Client.
Connect to the server with your FTP client. ... .
Navigate to the public_html folder..
Download the php. ... .
Open the file with any text editor..
Search for memory_limit without the quotes..
Enter the new memory limit for your PHP applications..
Save the file..
Upload the file using your FTP client..

How do I increase max upload size in Bluehost?

Editing upload_max_filesize and post_max_size.
Login to your Bluehost Control Panel..
Open the File Manager and select to go to the Web Root and click Go..
Then scroll in the right-hand panel to the file php. ... .
In the pop-up menu select Code Edit..
Click Edit at the bottom of the pop-up for Character set selection..

What is the maximum PHP memory limit?

Increasing the PHP memory limit The default memory limit is 256M and this is usually more than sufficient for most needs. If you need to raise this limit, you must create a phprc file.