Why json_decode causes Fatal error?

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 79 bytes)
most surprising to me is that if you run through the browser then everything is done.
But when I run through the console, it gets a fatal error pointing to this line of code.
get API mnogomernyi array.
Why all browser performs, then? and how to deal with it
$data = json_decode($result);
April 7th 20 at 15:21
4 answers
April 7th 20 at 15:23
Solution
ini_set("memory_limit", "1024M");
Okay, it turns out in this case to the crown/the console worked you just need to give php more memory.
Thank you.
Do I need to return to the place of the 256MB? or is it not necessary? - julian_Davis commented on April 7th 20 at 15:38
why through the browser is running? - julian_Davis commented on April 7th 20 at 15:26
through a browser running the media server through the crowns only by means of PHP - alanna1 commented on April 7th 20 at 15:29
5e497e550223b994137306.jpeg
Tell me, this cron? - julian_Davis commented on April 7th 20 at 15:32
through the console, crowns (the script in according to the schedule), is also performed by means of the console. - alanna1 commented on April 7th 20 at 15:35
@Cathryn_Harber, blaze in and blaze console in the browser have two different config, if that - Greyson.Schmitt commented on April 7th 20 at 15:41
@jerrod_Gutkowski36, what?! - Sydni_We commented on April 7th 20 at 15:44
April 7th 20 at 15:25
The error indicates insufficient memory to process the request. You probably have to use some php settings, and to console others. Perhaps even different versions of PHP. Check first this time.
April 7th 20 at 15:27
most surprising to me is that if you run through the browser then everything is done.
But when I run through the console, it gets a fatal error pointing to this line of code.

Why have you decided that they should have identical configs? On the contrary, the configs are usually different.

Well, error has no relation to json. If the memory limit is memory_limit, allocated by the PHP engine. Wherever you don't exceed it - get a fatal error, it's simple. And from here only two: try to reduce the memory consumption of the script or raise the limit.
April 7th 20 at 15:29
Install in php.ini `memory_limit`. The PHP that handles the requests from the web server can pull up the other config. Or even different versions of PHP. Make sure the console runs the appropriate version of PHP.

Find more questions by tags JSONPHP