Question: I had uploaded two PDF files to the server in php. but they are uploaded correctly but when uploading larger files I get an error. Iam using mysql server

How to upload large files(100 mb) in php?

Answer: 
**You may need to change the following options in php.ini file:**

1. upload\_max\_filesize (in php.ini or .htaccess only, won't work using ini\_set())
2. post\_max\_size (ditto)
3. memory\_limit (ditto)

Here is the explanation for each option:

**There are 3 settings PHP uses that limit your uploading ability:**

post\_max\_size

This is the combined maximum size of all files sent on the form. If you have 2 file fields on your form, the total filesize of the 2 files must not exceed the post\_max\_size value.

upload\_max\_filesize

This is the filesize limit of each individual file.

memory\_limit

PHP scripts have a memory limit, and generally speaking this can prevent some uploads from working. The limit should be set at a reasonable level, of course you won’t need 20mb for a simple ‘hello world’ script. Try slowly increasing this value if you find that uploads still aren’t working.
The suggestion to set max\_upload\_size and post\_max\_size is correct, but you may still encounter problems in some installations. One thing to remember when setting these values is that post\_max\_size is at least double the value of max\_upload\_size. In other words, if you set max\_upload\_size to 100mb, then post\_max\_size must be 200mb, otherwise the settings will be rejected and the engine will use the default settings of 2mb and 8mb instead. Also, you need to be sure that memory\_limit is at least the size of max\_upload\_size. If you crank up the post and upload sizes, but you are not allotting enough memory then you will still run into problems.