dongpai1942 2015-07-20 14:34
浏览 299

PHP脚本执行超出内存限制,即使限制更高

I have a PHP script on a Linux server that I am executing via command line like so: php script.php (note that it's not being executed as part of a web request).

The memory_limit in the server's "php.ini" file is set to "512M", and I have verified this as follows:

# echo "<?php phpinfo(); ?>" | php | grep memory_limit
memory_limit => 512M => 512M

Now, the issue is that when I execute the script in question via php script.php, eventually I get the following error:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 600283 bytes) in ...

268435456 bytes ~= 268mb, which is definitely lower than 512mb

What could be happening here? Is it possible there is another system-level setting I am missing? Or are php processes intrinsically limited to ~ 268mb?

  • 写回答

2条回答 默认 最新

  • dtyqflrr775518 2015-07-20 14:39
    关注

    Most likely php.ini settings didn't take effect. Restart the server again, and run script with phpinfo() to make sure your changes are in place.

    评论

报告相同问题?

悬赏问题

  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 Revit2020下载问题
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 单片机无法进入HAL_TIM_PWM_PulseFinishedCallback回调函数
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch