1

I am trying to change the max_memory parameter 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?

1
  • 3
    have u restarted the webserver? Commented Jul 10, 2011 at 3:42

2 Answers 2

2

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
Sign up to request clarification or add additional context in comments.

1 Comment

IT seems a certain man made 2 php.ini files and did not direct the configuration to read the one I was told to use lol. Thanks though somehow your answer led me to find it oddly enough haha.
1

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.

2 Comments

heh, you guys sorted it out while i was writing this :P
I am still having issues with uploading large files and I really believe it is a php issue since the file uploads fully into the tmp directory and then fails to move by move_uploaded_file() so I will look into your suggestions to try to test. I will get back to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.