Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes)

错误信息:
1,浏览器报500页面,
2,nginx日志报错信息如下:
[error] 11243#0: *11550 FastCGI sent in stderr: “PHP message: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 57257775 bytes)

解决方法:
因为php默认内存限制是128M,所以需要修改php.ini文件。
找到memory_limit = 128M这一行,将128M改大点,我这里直接是改成了1024M。
重启相关服务:
/etc/init.d/php-fpm restart
/etc/init.d/nginx restart

这个只是标准的解决方法,实际上是php文件写的有问题才造成内存溢出的。