Couple of days back while I was trying to upload some files on to my website, suddenly WordPress memory got exhausted and the following error started appearing on my screen, which was awful.
Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate 2348617 bytes)…
I tried searching for the solution a lot but unfortunately, nothing worked for me. Including WordPress forum and some most popular blogs that covers wide range of issues related to WordPress. The solutions that I found there were as follow, which were completely useless:
#1: Go to wp-config.php and add define(‘WP_MEMORY_LIMIT’, ’64M’);
#2: Open php.ini file and add memory_limit = 256M ;
The question is when I do not have the access to the server as I run a small blog that is being hosted on a shared space, how am I supposed to do that, so I contacted the support staff of hosting service provider and requested them for it.
According to them, they added it in php.ini file but for me it wasn’t working, not sure they were lying or what.
Ultimately, in the end, I found the ray of light in the darkness and that was the following, which worked for me, and finally I got rid of the issue.
- Create a new file using notepad
- Add this text to the file: memory_limit = 256M ;
- Save it as “php.ini”
- Upload the file to your WordPress site’s wp-admin directory
This solution is very helpful for those who got their sites hosted on a shared server and does not have the access to php.ini files.