dongshao8125 2018-05-30 10:09
浏览 239
已采纳

PHP - 无法在php-fpm上更改memory_limit

It might seem a stupid question, but I'm already trying since one hour to figure it out without success.

As stated in title, I'm actually unable to change memory_limit directive in PHP 7.1.15 but only for php-fpm. In fact if I execute php -i | grep memory_limit in terminal I can see the correct value memory_limit => -1 => -1.

What I tried so far:

  • Setting memory_limit in php.ini
  • Using ini_set('memory_limit', -1); directly in PHP script

I also tried to disable all loaded extensions cause I thought maybe one of them is overwriting that setting, but didn't work.

Also consider that edited php.ini file is the correct one since I was able to change max_execution_time without any problem.

So how this code

ini_set('memory_limit', -1);
echo ini_get('memory_limit');
exit;

can return 128M as output?

  • 写回答

2条回答 默认 最新

  • duanmei1930 2018-05-30 11:10
    关注

    To change the memory limit for PHP-FPM, add the following line to your php-fpm.conf file:

    php_admin_value[memory_limit] = -1
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵