开发者

cannot change php max_memory in php.ini

开发者 https://www.devze.com 2023-03-18 08:41 出处:网络
I am trying to change the max_memory paramete开发者_运维知识库r so I went into my php.ini and set max_memory = 500M For some reason, when I use phpinfo(), that setting still displays 128M (the default

I am trying to change the max_memory paramete开发者_运维知识库r so I went into my php.ini and set max_memory = 500M For some reason, when I use phpinfo(), that setting still displays 128M (the default setting). I read that some hosts restrict max_memory. Is there a way to change this value manually, or override this option in a config file, or do I have to recompile php?


If you can recompile PHP, then you, obviously, have full control of the web server.
I would guess, as written in the comments, you:

  1. Did not restart the Apache (or not the right Apache)
  2. (as you found) You are editing the wrong ini file.
  3. Your server simply don't have 500MB free memory


a few other things to check:

  1. the report from phpinfo states that it is using the php.ini file that you're editing, not some more "specific" .ini file somewhere else

  2. you haven't overridden the memory_limit variable through an apache .htaccess file or using ini_set in a PHP script somewhere

if you're in a shared environment, as Itay suggests, you may not have more than 128M available to your account, and you probably don't have access to reset apache either.

if that's the case, try making the value smaller to see if the changes you're making take effect. If they are, and you can't increase it above 128M, time to upgrade your hosting account.. otherwise, try making the change through .htaccess or ini_set in your script because those methods don't require an apache restart.

if you still can't get it to work, contact the host and ask them to make you a local copy of the global php.ini file for your account.

0

精彩评论

暂无评论...
验证码 换一张
取 消