-1

In my website, users upload files to the server for it to mix audio and redownload it to their device. For any file under 2MB it works just fine, but trying to do anything above 2M causes php error uploading file:1, meaning the file is too large. I looked at the configuration with the phpinfo() function and it says the limit is 2M, the standard even though I changed it multiple ways with no success. I am using Linux RHEL9.

I changed upload_max_filesize to 100M, post_max_size to 100M and when I ran the php -i | grep -i "upload_max_filesize|post_max_size|max_file_uploads" command, those new values were displayed, but after restarting httpd and checking phpinfo, it was still at 2M.

Aside from this, I also modified the .htaccess file with php_value upload_max_filesize 100M and restarted httpd, once again still at 2M.

I also added ini_set("upload_max_filesize" "100M"); and the equivalent for post_max_size but still get 2M.

If it helps, for some reason I also get an "unidentified array key 0" error only when uploading larger files - but that is for a line that connects to my stripe API, but don't have the issue otherwise.

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
dr3kiki
  • 9
  • 2
  • Are you using Plesk by any chance? – lezhni May 27 '23 at 01:25
  • Here is another thread wiht the answer you seek but in php 7. Not sure if it will also work for your version. https://stackoverflow.com/questions/37381522/php-7-php-ini-upload-max-filesize-not-working – Gerald Thornton May 27 '23 at 01:43
  • In your phpinfo() results, you will see the directory where your PHP expects php.ini file (**Configuration File (php.ini) Path**). Are you sure you modified the right one? – Nic3500 May 27 '23 at 01:50
  • `php -i` is for cli, use `phpinfo()` as Nic suggested. Some hosters do not allow changing`upload_max_filesize` in `.htaccess`. – steffen May 27 '23 at 07:34

1 Answers1

-1

Can't comment yet so I had to post an answer. I'm not too familiar with changing these settings so I had a quick read. I couldn't see a maximum limit you could set, but I did see this, not sure if it will help. https://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize

upload_max_filesize int

The maximum size of an uploaded file.

post_max_size must be larger than this value.

Specifically the post_max_size must be larger than this value. part. Maybe it's because you're setting them to be equal instead of post_max_size as bigger? As a troubleshoot you could try setting post_max_size to 0 to see if you can at least change your upload limit.

https://www.php.net/manual/en/ini.core.php#ini.post-max-size

Allow unlimited post size by setting post_max_size to 0.