Php.ini values don't update


I installed my own version of PHP 5.2.1, which has worked very nicely so far. However, I recently ran into the (absurdly low) size limit for uploaded files: 2M.

I located the php.ini file (the path is shown by phpinfo()), and noticed something odd: The value was set to 8M there.

I set it to 10M to test - phpinfo() shows it’s still 2M.

This is not limited to a single site, but happens on all sites that use my PHP installation.

Grepping for post_max_size and upload_max_filesize hasn’t turned up any other commands. In fact, grepping for “2M” has been completely fruitless.

The “2M” setting is shown by phpinfo() to be both the Local and Global value.

How can I track down where this 2M is set and change it?


The wiki has this to say about custom php.ini files…

You will need a local copy of php to make this work, but the instructions are basically on the wiki page.

The standard limit is 7m so something seems a bit strange. You might want to consider using a different upload script, say perl or python based as it will not have that limit either.

Wholly - Use promo code WhollyMindless for full 97$ credit. Let me know if you want something else!


[quote]Local copy of PHP


I did say I have that :wink:

[quote]Different upload script


Not an option, unfortunately. Drupal’s PHP-based uploading engine is part of its core, and I can’t replace or rewrite it.


You have to also change the maximum memory limit, which… well you can read the description from my php.ini file:

You may additionally consider using the other values I’ve included above, as they also occasionally affect PHP upload scripts (especially if you have a really slow upload like me!).


Mh… my memory limit is 128 MB - both in the php.ini and in the phpinfo() page.

Besides, I doubt that that is the problem. If it were, I would be seeing a sufficiently high upload_max_filesize in phpinfo(), but the script would crash with “memory limit exceeded”.

However, the problem here is that upload_max_filesize actually does show the value “2M”, even though the php.ini file named in “Configuration File Path” declares this value to be “20M”, and there is no .htaccess file that changes this anywhere.


Then I would have to say your php.ini file is either somehow setup wrong (probably not) or you have a typo somewhere that isn’t allowing that setting to be passed on.
My own php.ini file’s upload_max_filesize shows up correctly in phpinfo() and works as it should:

So I’m really quite stumped… maybe try grabbing a fresh copy of the php.ini file and only edit that setting? Just to see if it works anyways…


That could be the cause - because this is not the only problem. I’ve tried messing with other values (switching off uploads entirely, etc.) and seen no change to phpinfo(), so the file might be causing a parsing error.

I’ll look for a fresh php.ini file and modify it to see if that helps…

Edit: Didn’t do squat. I’m beginning to suspect that for some reason PHP doesn’t even read the php.ini file that is at this location - it certainly makes no difference whether the file is deleted or replace with a clean copy.

But it still says that the “Configuration File (php.ini) Path” is exactly the one where the php.ini file in question resides.

I have no clue what I’m doing wrong here…


In the php ini file just above magic quotes is the following:

; Maximum size of POST data that PHP will accept.
post_max_size = 20M

; Magic quotes
Then under file uploads is:

; Maximum allowed size for uploaded files.
upload_max_filesize = 20M


My website