问题

返回的json数据太大导致Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes)

PHP Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes)_json数据

解决方案

修改php.ini的memory_limit

修改 php.ini 中的 memory_limit 数值,默认 128M,不够用可以改成 256M 或 512M

PHP Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes)_微信公众号_02


宝塔中修改

PHP Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes)_json数据_03


点击“服务”>重启或重载配置即可。

PHP Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes)_php_04


再次查看

PHP Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes)_php_05

不需要的字段不返回

如果这篇文章对你有用,可以关注本人微信公众号获取更多ヽ(^ω^)ノ ~

PHP Allowed memory size of 134217728 bytes exhausted (tried to allocate 10489856 bytes)_微信公众号_06