1

I have root access to a dedicated server, I've set the php memory to 'unlimited' (-1) and confirmed the settings in my cpanel

Resource Limits memory_limit -1

But I'm still getting errors like this Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 88 bytes), 88 bytes, seriously?

I'm not hugely experienced with servers so even after googling how to increase memory limit I'm sort of stumped here.

underscore
  • 6,495
  • 6
  • 39
  • 78
andy
  • 2,746
  • 7
  • 47
  • 63
  • 1
    The `tried to...` is what it tried to allocate at the point the overall usage got too high - you were already using `41943040` bytes of memory in this script. If you want to use more than the 40ish megs you have, you need to contact your host to get *them* to upgrade the amount of memory that they are allocating to you, over and above what you have set your value to. – Fluffeh May 10 '14 at 14:02
  • Have you changed memory_limit in your php.ini file ? 40 MB for file is also very low (41943040) – Marcin Nabiałek May 10 '14 at 14:05
  • @MarcinNabiałek The OP has already set the memory usage to umlimited as the question shows. This is probably being over-ridden by his server host to limit what he can allocate. – Fluffeh May 10 '14 at 14:06
  • @Fluffeh I have complete root access to the server, there must be a way to change this without contacting my host. – andy May 10 '14 at 14:08
  • @andy Your host can be over-riding the values you enter if they are over what they want you to use. – Fluffeh May 10 '14 at 14:09
  • So if you have full root access you should look for php.ini file on your server and check what's in memory_limit set. You told you set php memory to -1 but where you have set it ? In php.ini file or somewhere else? – Marcin Nabiałek May 10 '14 at 14:09
  • I used WHM php configuration to set it, I can't seem to find my php.ini file, where should I look? After I done it, it says 'The php.ini has been written.' – andy May 10 '14 at 14:10
  • I'm not a Linux expert. You should simple search file in your filesystem with name php.ini and check if there's correct value in there. One more thing - have you restarted your Apache /other server after editing this file via cpanel ? – Marcin Nabiałek May 10 '14 at 14:23
  • Yeah I restarted apache and it still gives the same error. If I search php.ini I don't find one at the document root, but I find 1 in my wp-admin folder. Guessing that's not the one I want to edit. – andy May 10 '14 at 14:46
  • You can look at http://stackoverflow.com/questions/8684609/dude-wheres-my-php-ini to find your server php.ini file – Marcin Nabiałek May 10 '14 at 15:19

1 Answers1

0

if theres no php.ini file in the root folder, your host is controlling it. Some will allow you to create one in individual folders to override the settings for that folder so you can probably create one for the root folder.

If you get a 500 error...... Most hosts will have a php.ini file download for the correct settings for the server but they may still have security filters etc to manage php memory size, http post size etc

Anyway contact your hosting provider they wont think any less of you, they'll prob be thankful you have a genuine enquiry!

David
  • 5,897
  • 3
  • 24
  • 43