The error message you receive is:
Allowed memory size 33554432 bytes exhausted (tried to allocate 19456 bytes)
Indicates that you are trying to allocate more than 33554432 bytes that you can use; those. 32 MB:
This indicates that a failed distribution occurred when PHP attempted to allocate 19 KB; but no more than 32 MB was allocated - these distributions did not fail, since their sum was less than 32 MB.
Part of the error message "19456 bytes" is not true: the important thing is that your memory_limit set to 32 MB.
Given that memory_limit is a kind of security, it would be strange that your hosting provider allows you to change its value ...
If you are on a shared hosting, this will mean that anyone on the server can get any required memory ... What would it not be so nice for other users on the same server!
BTW: 32 MB is actually quite a reasonable value - I have never seen a server configured to allow more than 32 MB for a web application ... And the default value for PHP 5.2 seems to be 16 MB, according to the manual .
(And I worked with Drupal for several months)
About the 500 error, I donโt have many ideas ... One of the possibilities may be that safe_mode activated, and that it does not allow setting memory_limit at runtime.
The manual does not say much about this, but there is some information in the max_execution_time directive:
You cannot change this parameter with ini_set() when working in safe mode. The only workaround is to disable safe mode or by changing the limit time in php.ini.
I believe the same is true for memory_limit ; still logical.
source share