Maximum php file size

I am trying to use the file upload capabilities of PHP, but when I try to download certain file sizes (e.g. 9 MB), it fails. Smaller files go fine.

Even when I set the error report to "E_ALL" and try to upload a larger file. I do not see an error message.

I tried installing these lines at the top of a PHP script that downloads files, but still does not go:

ini_set('memory_limit', '96M'); ini_set('post_max_size', '96M'); ini_set('upload_max_filesize', '96M'); 
+4
source share
4 answers

Take a look at the list of options for PHP and where you can set them . If I read this list correctly, post_max_size and upload_max_filesize can only be set in php.ini, not through ini_set.

Set these values ​​in the appropriate php.ini (for CLI and mod_php), or if you do not have access to the main php.ini, create php.ini in your folder.

To check if the settings work, create a phpinfo file and check the values.

+5
source

try modifying the php.ini file that has certain properties.

you can change all the properties that you mentioned in your php file into your ini file, this worked for me. Try it if it works for u as well

+2
source

Try setting the MAX_FILE_SIZE record in the form.

 <input type="hidden" name="MAX_FILE_SIZE" value="100663296" /> 

where the number is in bytes. Also, try changing the PHP settings in the php.ini or .htaccess file in the same directory. The syntax for php settings in htaccess files is:

 php_value name value 

So you would say:

 php_value memory_limit 96M php_value post_max_size 96M php_value upload_max_filesize 96M 

In addition, you use your own server or some kind of Internet site. Some Internet hosts set a maximum file upload limit, which must be changed on the control panel (depending on which interface the host uses), or simply do not allow changing the maximum file size.

0
source

I do not see an error message.

because file upload has its own error messages. check $_FILES['filename']['error']

I tried to set these lines

but you didn’t check if it has an effect! execute phpinfo() to see the actual values

0
source

All Articles