致命错误:允许的内存大小 67108864 字节已耗尽

发布于 2024-11-29 23:21:58 字数 418 浏览 0 评论 0原文

我有一个脚本在特定服务器上让我头疼。

我不断收到此错误:

致命错误:允许的内存大小为 67108864 字节耗尽

即使我已将 php.ini 编辑为:

max_execution_time = 300     ; Maximum execution time of each script, in seconds
max_input_time = 600    ; Maximum amount of time each script may spend parsing request data
memory_limit = 96M    ; Maximum amount of memory a script may consume (16MB)

67108864 字节限制来自哪里?

I've got a script that's giving me headaches on a particular server.

I keep getting this error:

Fatal error: Allowed memory size of 67108864 bytes exhausted

Even though I've edited php.ini to this:

max_execution_time = 300     ; Maximum execution time of each script, in seconds
max_input_time = 600    ; Maximum amount of time each script may spend parsing request data
memory_limit = 96M    ; Maximum amount of memory a script may consume (16MB)

Where would the 67108864 bytes limit be coming from?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

想你的星星会说话 2024-12-06 23:21:59

我遇到了类似的问题。这可能是因为您在某个变量中存储了非常大的数据,或者从 mySQL 表中选择了大量数据。您需要提供有关脚本的更多信息,因为 64M 确实足以执行大部分处理。

I faced a similar issue. It might be because you're storing something very huge in some variable or selecting a lot of data from your mySQL table. You need to provide more information about your script because 64M is really sufficient to execute most of the processing.

沧桑㈠ 2024-12-06 23:21:59

通过阅读评论,很明显您正在使用共享托管帐户。

这些通常不允许您编辑自己的 php.ini,也不允许对您的喜好进行任意限制。这将很快关闭共享托管服务器。

By reading the comments, it's obvious you're on a shared hosting account.

Those usually don't let you edit your own php.ini, nor allow arbitrary limits to your pleasing. This would quickly take down the shared hosting server.

甜宝宝 2024-12-06 23:21:58

首先,据我所知,它必须是96M(不含B)
其次,确保您正在编辑正确的 php.ini,并且在更改后重新启动 Web 服务器(例如,如果 PHP 作为 apache 模块加载,则需要)。

第三,增加内存限制可能会解决问题,但最好检查一下为什么 64M 不够:)

First, as far as I know, it has to be 96M (without the B)
Second, make sure you are editing the correct php.ini, and you are restarting the web server after the change (needed if PHP is loaded as an apache module for example).

And third, increasing the memory limit may resolve the problem, but it's best to check why 64M are not enough :)

走过海棠暮 2024-12-06 23:21:58

你重启apache了吗?有时这是必要的。

Did you restart apache? Sometimes it's necessary.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文