The default upload file size for WordPress is 2 MB, which is a problem if you want to upload a large media files. If you get this error, “The uploaded file exceeds the upload_max_filesize directive in php.ini”, follow these steps:
- Locate the php.ini file inside the wp-admin directory (if you can’t find this file see notes below)
- Find this line in the php.ini file “upload_max_filesize = 2M” and replace it with a higher value (e.g. “upload_max_filesize = 64M”)
- You may also want to increase your max post size. Look for this line in your php.ini file “post_max_size” and increase it as well.
- Save the changes to the file inside your wp-admin directory.
- Try the upload again
- If you still have issues, look for this file in your root directory and make the same changes.
If you don’t have a php.ini file in your directory, you can usually generate one from the control panels of your host. BlueHost has the steps listed to generate a php.ini file.
If you don’t have a php.ini file in your directory and aren’t sure where to get one (or want to see where I made the changes in the code), you can download my php.ini file. I have already increased the upload_max_filesize and the post_max_size to 64M. Once this file is copied into your wp-admin folder, the problem should be solved.