Latest blog posts

header ads

How to Increase Upload Max File Size in WAMP for WordPress

If you’re running a WordPress site on a local WAMP server, you might encounter an error when uploading large files. This happens because the default upload_max_filesize is often set to 2MB. This guide will help you increase the file upload size limit step by step.

Step 1: Locate the php.ini File

The php.ini file contains settings for PHP, including file upload limits, memory usage, and execution time. WAMP has multiple php.ini files, so it’s crucial to edit the correct one.

  1. Open WAMP and click the WAMP icon in the system tray.
  2. Navigate to PHP > php.ini to open the configuration file. Alternatively, locate the file manually: C:\wamp\bin\php\php{version}\php.ini
  3. Verify the correct file by creating a phpinfo.php file with this code:
<?php
phpinfo();
?>
    

Open this file in your browser and check the Loaded Configuration File path.

PHP Info Configuration Path

Step 2: Update PHP Settings

Edit the php.ini file and update these settings:

upload_max_filesize = 64M
post_max_size = 128M
memory_limit = 256M
max_execution_time = 300
max_input_time = 300
    

Save the file and close it.

Editing php.ini File

Step 3: Restart WAMP Services

After editing the php.ini file, restart WAMP to apply the changes:

  1. Click the WAMP icon in the system tray.
  2. Select Restart All Services.
Restart WAMP Services

Step 4: Update .htaccess (Optional)

If WordPress or Apache settings override your changes, update the .htaccess file in your project folder. Add this code:

# Custom PHP settings for file uploads
<IfModule mod_php.c>
    php_value upload_max_filesize 64M
    php_value post_max_size 128M
    php_value memory_limit 256M
    php_value max_execution_time 300
    php_value max_input_time 300
</IfModule>
    

Ensure this is placed outside the # BEGIN WordPress and # END WordPress markers.

Editing .htaccess File

Step 5: Verify Changes

Refresh your phpinfo.php file and look for the updated values for upload_max_filesize and post_max_size.

Verify Updated PHP Settings

Troubleshooting

  • Changes Not Reflecting: Ensure you edited the correct php.ini file and restarted WAMP.
  • Conflicts with .htaccess: Check for other overrides in the file.
  • Multiple PHP Versions: Ensure you updated the php.ini for the active PHP version.

Conclusion

By following these steps, you can increase the file upload limit in WAMP, allowing your WordPress site to handle larger uploads without errors. If you still face issues, double-check your configurations or let us know for further help.

Post a Comment

0 Comments