How to fix WordPress’s maximum-upload problem with php.ini

I was helping a friend recover her group’s WordPress-powered site when I encountered possibly one of the more common problems when importing a database to WordPress: a message that says you cannot upload more than 2mb worth of file. The initial database I tried to upload was 6.5mb, way beyond the default limit.

There’s a way to fix this, of course.

The first step is to find in your site’s root directory — inside the folder that says public_html — a file named php.ini. If you cannot find it there, go to the wp-admin folder of your WordPress installation. If it’s there,  it should look like this:

[PHP]

; Increase maximum post size

post_max_size = 2M

; Increase maximum upload size

upload_max_filesize = 2M

Using FTP, download the php.ini file and open it using Notebook. Change the 2M to whatever you want, say, 10m or 20m. Then upload it, overwriting the existing file.

If you can’t find a php.ini file anywhere in your folders, create one using Notebook. Copy the block of code above with your corresponding change of number and save it with the file name php.ini. Be sure not to save it under Notebook’s txt extension — choose “all files” when saving it.

The using FTP, upload it to the wp-admin folder of your WordPress installation. That should fix the problem.

Leave a Reply