exec 命令上允许的内存耗尽不会导致异常

发布于 2025-01-20 20:51:08 字数 289 浏览 1 评论 0原文

我使用exec在Laravel PHP中解开大块的ZIP文件。在某些情况下,以过多的内存使用形式发生错误: 允许的内存大小为2097152字节耗尽的< / code>

我的问题是我在系统日志 /工匠控制台中获取此消息,而不是在PHP中获得此消息。在php中,我的代码只是在exec行之后不会继续执行,但不会引起任何错误/异常,这使我无法对通知用户或重试(或至少删除删除)做出反应现在毫无用处的块)。

发生此问题时,是否可以知道PHP内部?

I am unzipping large chunked zip file using exec in Laravel PHP. With certain situations, an error occurs in the form of an excessive memory usage:
Allowed memory size of 2097152 byte s exhausted

My problem is that I get this message in the system log / artisan console, but not in the PHP. Inside the PHP my code just won't continue executing after the exec line, but it does not cause any error/exception, which prevents me to react informing the user or retrying (or, at least, deleting the now useless chunks).

Is it possible to know inside PHP when this problem is occurring?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文