More often than not we encounter php related issues on shared hosting. While its really easy to solve, there are not many articles on the internet that shows the process in a simple end to end way, so beginners find it difficult to solve issues related to memory limit and there are a lot of questions on this topic in developer community forums like stackoverflow. So I am going to demonstrate how to solve memory limit issues on shared hosting using a use case scenario where wordpress detects memory issues on Godaddy shared hosting. This is in no way a promotion of wordpress or godaddy, and this method will work on most, if not all scenarios.
Solve Memory limit issues on Shared Hosting
While trying to download demo files for a wordpress theme I encountered these errors:
In this case, I had already increased ‘memory_limit’ for my shared hosting, but other four parameters need their values increase. Since the process is exactly the same, this example would have worked fine, still I decided to increase ‘memory_limit’ to 256M.
Step 1: If you’re not shown php parameter values like this, you can create a php file(something.php) in your root folder and add the code “phpinfo()” on the file. When you go to the url to that file in your browser you’ll see this:
Here you can check values of all php parameters for your shared hosting.
Now to change those parameters, you’ll have to create a php.ini file, if its not already present, or else edit it.
Step 2:To create the file log into your cpanel dashboard:
Step 3: Go to File Manager. You’ll be taken to the root folder of your hosting account. Its generally public_html. Create a file named php.ini:
Step 4: After that select the file and click ‘edit’ from the top menu:
Step 5: Enter these lines of code(change the values to your requirements):
Step 6: Save the file and check the php parameters on your browser as demonstrated in step 1.
This should solve your php related issues on the shared hosting. If problem persists feel free to comment below.
If you liked this article please comment and show your support and interest so that I’ll be motivated to continue this effort. Like our facebook page if you haven’t already.