zblog或PHP的网站错误提示:PHP Fatal error: Allowed memory size of 134217728 bytes exhausted解决方法
提问:文章是可以保存的,但是,每次都提示如下,这是我用日志里看到的,请问如何解决?
[16-Sep-2019 13:53:25 Etc/GMT-8] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 40867 bytes) in /data/home/xyu4551770001/htdocs/zb_system/function/lib/base.php on line 186
[16-Sep-2019 13:54:22 Etc/GMT-8] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 7145 bytes) in /data/home/xyu4551770001/htdocs/zb_system/function/lib/base.php on line 186
[16-Sep-2019 13:55:35 Etc/GMT-8] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 19643 bytes) in /data/home/xyu4551770001/htdocs/zb_system/function/lib/base.php on line 186
[16-Sep-2019 14:17:36 Etc/GMT-8] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 90238 bytes) in /data/home/xyu4551770001/htdocs/zb_system/function/lib/base.php on line 186
[16-Sep-2019 14:27:39 Etc/GMT-8] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 51328 bytes) in /data/home/xyu4551770001/htdocs/zb_system/function/lib/base.php on line 186
解决方法:
终端报出了Allowed memory size of 134217728 bytes exhausted错误,而且重启电脑再次执行仍然是一样。上网查了查,是因为php默认内存限制是128M,所以需要修改php.ini文件。
1、查找到memory_limit = 128M这一行,将128M改大点,我这里直接是改成了2048M。
2、重启服务器,通过sudo /usr/sbin/apachectl restart来重启apache服务器,当然其实用终端执行php的话,不重启服务器也是可以的。
3、重新执行php文件,成功,OK
本站声明:网站内容来源于网络,如有侵权,请联系我们https://www.qiquanji.com,我们将及时处理。
微信扫码关注
更新实时通知