PHP中允许的内存大小为134217728个字节(尝试分配32个字节)

I am facing issue in my code, when I am trying to store the file_get_contents output into an obj.

$json = file_get_contents($url);
$obj = json_decode($obj);

I am not allowed to change the memory size in ini.php because it is on server.Any other solution for this.?

You have a simple typo:

$json = file_get_contents($url);
$obj = json_decode($json);

Have you tried other options of increasing memory limit? Like

ini_set('memory_limit', '-1'); //change the -1 to a value that acommodates to your use case
$json = file_get_contents($url);
$obj = json_decode($json);

ini_set('memory_limit', '256M');

or set bigger memory