Trying to import demo content on your shiny new WordPress theme and getting errors? The most likely cause is because of low PHP limits on your hosting account. The default PHP limits for allotted memory, execution time, and other variables are very conservative for most shared hosting accounts. Today I’ll show you how to solve that problem on GoDaddy’s cPanel shared hosting accounts.
1.) Get into your cPanel management area
After logging into your GoDaddy account, navigate to the “My Products” page and scroll down until you see “Web Hosting”. Go ahead and click on “Manage”.
2.) Open up File Manager
Now that you’re on the cPanel management screen we’re going to look at the top of the page. There you will see the link for “File Manager”, click on it.
3.) Create a new file
Once in File Manager, we’re going to be creating a new file called “php.ini”. This file will be recognized by the server and it will load the PHP limits specified instead of the defaults.
4.) Name the new file php.ini
Go ahead and name the file php.ini, make sure it’s going into the /public_html directory (it will by default), and click create.
5.) Edit and save the new file
Now that the file is created, click on it (it will be in the /public_html directory) and then click “edit”. An in browser code editor will open up showing a blank document. Copy and paste or type in the PHP limits your theme developer recommends. You can see mine listed below as an example. Once you are done click the blue button “save changes” and then “close”.
In this example I have entered in the following parameters:
max_execution_time = 300
max_input_vars = 3000;
upload_max_filesize = 64M
Max execution time is the amount of time, in seconds, that a PHP script is allowed to run. Some themes have large amounts of content to transfer over, so they need a little extra time to complete. Max input vars is how many input variables (from GET or POST) are allowed to be accepted. Lastly upload max filesize is a little more on the nose than the others. Put simply, it sets the absolute size for your files being uploaded through WordPress. Any file over this value (in my case 64MB) will error out. If you do plan on uploading large files or at least large quantities of files, I would recommend using an FTP client instead.
For a list of PHP values, view the manual here http://www.php.net/manual/en/ini.list.php
6.) Go back to the main cPanel area
Now that the file is created we are going to go back to the main cPanel management area. Once there find “PHP Processes”. You can type “php” into the search bar at the top and it will automatically filter your available options. Click on the “kill processes” button on this new page. Doing so will force any current processes to restart and take your changes into effect.
7.) Verify your newly changed PHP limits
Most themes will have a “system status” page available so you can check your system settings. If you do, navigate there and verify the settings reflect your changes. If not I would recommend reaching out to the hosting provider support line so they can take a look. You can see my values for the PHP limits changed to the exact parameters I entered in the php.ini file.
If you don’t have cPanel with GoDaddy there are other files that can be modified. Here is a help article from them that shows which file you need to edit to make changes on the PHP limits. GoDaddy – What filename does my PHP initialization file need to use?