PHP – Increasing File Upload Limit

ftpupload

Im running CentOS.

Im not exactly sure the standard max upload limit in PHP,

but i tried to upload an 8MB file and i see a loading status on my browser, when it reached 100, it does nothing. the file was not successfully uploaded.

my php.ini

upload_max_filesize = 50M

post_max_size = 50M

when i try uploading using Filezilla, im not having any problems at all.

Best Answer

PHP is executed after POSTed data has been transmitted to the server. If you were to upload a 1GB file, then it would be up to your web server to stop the upload when it reaches your limit. This is why you see your web browser run and complete the upload before it fails.

After the data is uploaded, then the web server will execute PHP. The php.ini settings are used to see if the posted data exceeds the allowed limit. If it does, then PHP will reject it.

If the file is uploaded via a posted form, then the post_max_size is checked. It doesn't matter if the form submitted a file attachment, or just contains a large amount of data. PHP will check this parameter to see if the posted data is too large.

set_time_limit(0); will not resolve issues related to long upload times. Since the web server does not execute PHP until all the posted data is received. If there is a problem during the sending of the data to the server, then the issue may be in the web server.

Filezilla is a FTP client and has nothing to do with PHP.