1

I have faced issue of upload_max_filesize , I have updated php.ini file on server with adding following.

memory_limit = 500M
post_max_size = 500M
file_uploads = On
max_execution_time = 600
max_input_time = 900
upload_max_filesize =500M

enter image description here

Also I have updated .htaccess file like..

<IfModule php7_module>
   php_flag display_errors 
   php_value post_max_size 500M
   php_value max_execution_time 330
   php_value max_input_time 260
   php_value max_input_vars 1000
   php_value memory_limit 500M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php70"
   php_value upload_max_filesize 500M
</IfModule>

But still i am getting same error The uploaded file exceeds the upload_max_filesize directive in php.ini , I just trying to upload 2MB video but getting same error.

Why does it i happen i don't know , I have also words with server support center and they told me that they have set 500MB max_upload_size.

Samir Sheikh
  • 2,283
  • 2
  • 19
  • 37
  • you also need to edit this value in your php.ini file 'upload_max_filesize = 40M' . This will do the job. – Sumit Kumar Apr 09 '19 at 05:06
  • 2
    @SumitKumar i have already added 500M in php.ini – Samir Sheikh Apr 09 '19 at 05:08
  • 2
    What application are you using? Some CMS's have their own setting for this as well. – M. Eriksson Apr 09 '19 at 05:09
  • Please check script_filename in phpinfo shown above. It may happen that it may have different location or it is overwritten by any other means. – Pupil Apr 09 '19 at 05:10
  • I am using core php not any CMS version 5+ – Samir Sheikh Apr 09 '19 at 05:10
  • 1
    `post_max_size` is too low. You can see in your screenshot it is 8M – Phil Apr 09 '19 at 05:11
  • @Pupil I have configure phpinfo on server and it's location is also correct, I have already checked. – Samir Sheikh Apr 09 '19 at 05:12
  • 3
    Did You restart your web server after editing your php.ini file? – Sumit Kumar Apr 09 '19 at 05:12
  • @Phil I have set 500M and we only trying to upload videos under 500MB so this size is enough for us. – Samir Sheikh Apr 09 '19 at 05:13
  • Why does your screenshot show 8M then? – Phil Apr 09 '19 at 05:13
  • @Phil I'll look on this but i am trying to upload 2 MB video then why does error coming ? We are trying to upload max 5-6 MB videos not more size. – Samir Sheikh Apr 09 '19 at 05:16
  • PHP does not generate any messages like _"The uploaded file exceeds the upload_max_filesize directive in php.ini"_. A quick Google suggests that's a Wordpress error message. Are you sure you're not using a CMS like Wordpress? – Phil Apr 09 '19 at 05:17
  • @Phil I am not using wordpress , I am using core PHP and that error showing using $_FILES['file_name']['error']; If file is not uploaded then showing error message using this. – Samir Sheikh Apr 09 '19 at 05:19
  • Pretty sure the `error` property is an integer. The message does not come from PHP. Find the code the produces that error and check the logic – Phil Apr 09 '19 at 05:20
  • @Phil , Please look this URL https://www.php.net/manual/en/features.file-upload.errors.php, I am getting value of 1 integer it's UPLOAD_ERR_INI_SIZE error – Samir Sheikh Apr 09 '19 at 05:22
  • Like I said, it's an integer but your error clearly shows a string message. What is producing that message? What logic is it using to determine the error? – Phil Apr 09 '19 at 05:23
  • @Phil Yes i am getting integer value of 1 but you can see error message description over here https://www.php.net/manual/en/features.file-upload.errors.php, – Samir Sheikh Apr 09 '19 at 05:24
  • Please check this : https://stackoverflow.com/questions/8300331/php-whats-the-point-of-upload-err-ini-size – Bannarisamy Shanmugam Apr 09 '19 at 06:11

0 Answers0