Nginx错误内存

我有一个Nginx + PHP的问题。 这是错误的

PHP message: PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 896464024 bytes) in /sistemas/html/producao_11003/prod/third/zipfile/zipfile.php on line 122" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: XXX.XXX.XXX.XXX, request: "POST /11003/BackupProcess/BackupProcess.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "xxx.xxx.xxx.xxx.", referrer: "https://xxx.xxx.xxx.xxx/11003/gerarBackup/gerarBackup.php" 

我尝试增加php.ini中的memory_limit在我的info.php工作,但是当我再次运行命令我得到同样的错误。

在我的php-fpm这行有评论

 ;php_admin_value[memory_limit] = 128MB. 

所有你需要在日志中:

 Allowed memory ... 2147483648 bytes ... tried to allocate 896464024 bytes 

这意味着你设置值2GB,并且应用程序需要更多(900Mb)。 如果您确定没有内存泄漏 ,并且应用程序确实需要使用如此大的数量,则只有一种方法:您应该增加memory_limit值。 但! 你最好知道应用程序中发生了什么

gerarBackup.php和zipfile.php …看来你的应用程序试图处理一个大文件。 所以,这个错误是预料之中的。

php.ini中将内存限制增加到10 GB。 重新启动nginxphp-fpm