wamp

How to increase PHP Memory Limit and File Upload size

Published on Author bloggerzeroLeave a comment

Increasing PHP Memory Limit and File Upload size

For WAMP

While importing a large database in PHP MyAdmin, or any other MySQL interface,we face server time out or maybe the file upload size is limited to say 2 MB or so. All you need to do is, you have to edit you php.ini file to increase the PHP memory limit and the file upload size. If you are using WAMP the follow the steps:

  1. Go to php.ini  using GUI

Or

C:\wamp\bin\apache\apache2.2.8\bin\php.ini (go to the respective directory if WAMP is installed in a         different location)


Find below configuration

  1. post_max_size = 8M
  2. upload_max_filesize = 2M
  3. max_execution_time = 30
  4. max_input_time = 60
  5. memory_limit = 8M

Modify to:

  1. post_max_size = 750M
  2. upload_max_filesize = 750M
  3. max_execution_time = 5000
  4. max_input_time = 5000
  5. memory_limit = 1000M

3. Now restart WAMP for the changes to effect.

For LAMP

1. Become root by

   $ sudo -s 

2. Edit /etc/php5/apache2/php.ini by following command

      $ vim /etc/apache2/php.ini 

3. Now change the following in this file as
Completed example, to increase 10Mb

upload_max_filesize = 10M ;
post_max_size = 20M ;
memory_limit = 128M

4. Close the file.

5. Restart apache by following command

   $ sudo /etc/init.d/apache2 restart 

6. That’s it your uploading or importing file size is increased up to 10mb.

Comments

comments

Leave a Reply

Your email address will not be published. Required fields are marked *