Answer the question
In order to leave comments, you need to log in
Why does json_decode cause Fatal error?
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 79 bytes)
The most surprising thing for me is that if you run it through a browser, then everything is done.
But when I execute through the console, a fatal error appears pointing to this line of code.
I get a multi-dimensional array via API.
Why does everything in the browser perform then? and how to deal with it
$data = json_decode($result);
Answer the question
In order to leave comments, you need to log in
The error indicates that there is not enough memory to process the request. Most likely you have some php settings for the site, and others for the console. Maybe even PHP versions are different. Check this point first.
The most surprising thing for me is that if you run it through a browser, then everything is done.
But when I execute through the console, a fatal error appears pointing to this line of code.
Set `memory_limit` in php.ini . The php that processes requests from the web server can pull up another config. Or even different versions of PHP. Make sure that the correct PHP version is running in the console.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question