Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php [duplicate]
(24 answers)
Reference - What does this error mean in PHP?
(38 answers)
Closed
4 years ago
.
I am transferring website from one host to another.
A very strange error occurred that I haven't seen before.
PHP Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes)
I thought that this was a wp memory limit issue so I added this to my wp-config.php file
define( 'WP_MEMORY_LIMIT', '8096M' );
define( 'WP_MAX_MEMORY_LIMIT', '8096M' );
But the website keeps returning error 500, and this error in my error log.
Anyone any ideas?
–
–
–
In Wordpress PHP file(s) :
Try to add ini_set('memory_limit', '1024M');
on pages that causes the error (or in a PHP file included on all pages)
In php.ini : Search the php.ini file read by your PHP server and try to increase the memory_limit
parameter (never set this key at -1
because it can freeze the server if you (really) have a problem in your code).