Avatar of Sudaraka Wijesinghe
Sudaraka Wijesinghe
Flag for Sri Lanka asked on

Can't change PHP (.ini) post/upload limit

I'm trying to change the post_max_size (32MB) and upload_max_filesize (12MB) on my server, but they keep falling back to defaults (8MB and 2MB respectively).

Here are some details of the scenario:
Server: VPS hosted by GoDaddy (\w 3GB Ram and 1.5TB monthly bandwidth)
OS: CentOS 5.4
Apache: 2.0
PHP: 5.2.10

I have ruled out following obvious causes:
1. Apache is restarted after modifying the php.ini
2. There's only one php.ini on the whole server, so I'm 100% confident I'm working with the correct php.ini (other setting I change take effect perfectly)
3. GoDaddy has confirmed that they don't have any restrictions or caps on the php settings and I'm free to modify them.

Has any one faced this issue before? (On GoDaddy or any other server) or can any one shed some light on the situation?

Thanks In Advance.
PHPApache Web ServerLinux

Avatar of undefined
Last Comment
Sudaraka Wijesinghe

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
medvedd

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
jar3817

How are you checking the current values? phpinfo()?
Linux Guru

Hi,

Please create an info.php file with the following contents.

<?
phpinfo();
?>

Now access the info.php file using browser and check the location of "Loaded configuration File". You need to edit the php.ini file mentioned in the "Loaded configuration File". Also you can check the post_max_size and upload_max_filesize in the info.php. Also it will be helpful if you could take a screen shot of the info.php and attach it here to check this further.
Sudaraka Wijesinghe

ASKER
Thanks every one for their participation.

medvedd's suggestion worked.

Before I close this, I would like to discuss why I was able to set the php configuration from .htaccess but not from the php.ini?
Any ideas?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Linux Guru

PHP can run in the following ways.

    * php run as Apache Module
    * php run as CGI / Fast Cgi
   
php_flag and _php_value can be written in httpd.conf in FastCGI, but not in .htaccess file. if PHP is running as module, you can do anything with .htaccess. So I think your PHP is running as Apache module.
Sudaraka Wijesinghe

ASKER
yes, it is running as Apache module, but that doesn't explain why I couldn't set the configuration values from php.ini? or is it?
SOLUTION
Linux Guru

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SimonDard

You can check phpinfo() to make sure that the php.ini you mention is also the one that gets loaded/parsed.

Other than that, a stray .htaccess, safe mode or module for added security (e.g. Suhosin) could be a cause.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Sudaraka Wijesinghe

ASKER
Thanks again to everyone for their participation.

My problem was solved using medvedd's suggestion.
And award some points to testez for his informative posts and eagerness to help.