doulu8341 2017-09-17 03:19
浏览 131
已采纳

更改php.ini中的设置对性能没有影响

I am trying to use php GD library to compress jpg images, and some of the answers on stackoverflow says that GD library uses too much memory. So I tried to lower the memory_limit on php.ini and run my script to see if I will encounter any errors. I kept lowering the memory_limit until it hits 128k, and the size of the compressed jpg image is 266 kb. To my surprise, I did not encounter any error. Then, I kept lowering the memory_limit until it reaches 0, and surprisingly, my script can still compressed image without error. I try uploading a 1.3MB image on another script, and it still works, even though memory_limit is set to 0. I checked the path of php.ini at phpinfo to make sure that I am looking at the correct php.ini document. How come changing php.ini has no impact on my php scripts at all?

  • 写回答

1条回答 默认 最新

  • duanjiaoxi4928 2017-09-17 03:42
    关注

    You have to restart your web server after making a change to the ini file (assuming you have a pretty typical setup). You can use phpinfo() to display the current configuration settings and validate that the changes took effect after restarting the web server.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记