Recently whilst installing some plugins/templates for WP I came across this error whilst trying to access the wp-admin for a wordpress install.
Fatal error: Allowed memory size of 41943040 bytes exhausted ....
We are on a shared server, so changing settings directly was not going to be a solution
By creating the famous phpinfo() file I saw that the memory_limit = 32M
… I hit upon this:
Create a php.ini file in the home directory and add in this line -with whatever memory_limit you want
memory_limit = 128M;
That’s good, except that it only works for the folder within which the php.ini file was sitting – we need to make it so that every folder would (as it were) carries out this command – this is called making it ‘recursive’ and is done in the .htaccess file.
Where’s my .htaccess file eh?
Now, wordpress doesn’t create the .htaccess file until you set the permalinks – something it took me a good 15 minutes of surfing around to discover. Here was a problem. I needed to get into the backend of WP but it was unavailable due to the memory limit! What to do?