WordPress is a great content management system. But sometimes it’ll give you a headache. Some of us might see this error “The uploaded file exceeds the upload_max_filesize directive in php.ini” or something like that when we trying to upload files into the WordPress site. Actually it’s not WordPress’s problem. This is because your server has a limited maximum uploading size. Most servers set 8MB as it’s default maximum file upload size.
So, how can I fix this issue? You can solve this issue in 4 methods.
Open your “wp-admin” folder in your WordPress installation and create a file with the name “
php.ini“. Open this file for edit and copy/paste the following lines and save the “php.ini” file.
memory_limit = 100M upload_max_filesize = 150M post_max_size = 100M file_uploads = On
The above lines will increase the uploading limit up to “
150MB” Also it increases the memory limit up to “100MB”. This will work on most servers however some have an issue with this. If your server not supporting this method check out the next one.
Open the functions.php file, that located in your current WordPress theme folder, for edit. and copy/paste the following lines of code at the top of the file then save the file.
@ini_set ('upload_max_siz' '64M '); @ini_set ('post_max_size', '64M '); @ini_set ('max_execution_time', '300 ');
.htaccess file, located in your root folder of the WordPress installation and copy /paste the following code then save the file.
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
define ('WP_MEMORY_LIMIT', '64M ');
.wp-config.php file, located in your root folder of the WordPress installation and copy /paste the following code then save the file.
If these methods didn’t work please ask your host provider to increase the uploading size.