0 0
Read Time:5 Minute, 32 Second

Have you ever wanted to upload something to your website and you are returened with the error maximum upload size exceeded ? it can be very annoying.By default, maximum upload size in WordPress,joomla set by hosting providers range from 2MB to 150MB depending on the settings of your web hosting provider is giving by default.If you are building a WordPress website that hosts a portfolio with large image files or a video hosting site with single media file size running into GBs, then you might face a roadblock of not being able to upload media files larger than 25MB (in most cases). I recently encountered this challenge and i could not find the php.ini file in my cpanel. i could not find helpful methods on the net, but using the methods i’m about to show you, i was able to increase to 250mb. normally the php.ini method is all over the net.what if like me you could not access the php.ini file? most providers don’t allow you access to this file. To check what is the current max upload size limit in your WordPress site then navigate to WP Admin -> Media -> Add New. You will see the current max upload size on the bottom
in this tutorial i will be putting you through several steps and strategies that will help you out.
method 1
if you’re using wordpress then you are a bit at an advantage.
You can easily increase the size limits by adding the following lines of code in the functions.php file of your theme.

However, remember if you change the theme then max upload size will return to its default values until you edit the functions.php file of the new theme.and chang the values in the following lines of code.

note: i used 56m for sample, replace with your own desired value.
@ini_set( ‘upload_max_size’ , ’56M’ );
@ini_set( ‘post_max_size’, ’56M’);
@ini_set( ‘max_execution_time’, ‘300’ );
method 2
Editing PHP.ini
this is the most common method.
Note: Before you start making changes to your server’s configuration, you should make a backup of your site and database. If you find your php.ini file, you will also want to back this file up locally.
Depending on your web host, you may be able to edit this php.ini file directly. To find this file, FTP into your site, and go to the folder that your WordPress install is in. This usually exists in an “html” or “www” folder. What you will need to do is navigate via FTP to the absolute root directory. This will typically be one or two directories higher than where the WordPress files live.
From the root directory of your server, you are looking for the folder that your php.ini file is located. This is typically in a “conf” or “etc” folder. Search through these folders to find a file labeled “php.ini”. If you are unable to locate it, trying searching through your web host’s knowledge base to find its location.Drag this file to somewhere on your local hard drive, and open it up in any text editor.you can also do this from your cpanel using the editor in your file manager., find the “memory_limit” value, and change this to 56M (unless this is already set to something higher). Next, find the the “post_max_size” and change this to 56M. Finally, find the “upload_max_filesize” and once again change this to 56M. It is important that we use an “M” to define our filesize limit in megabytes, instead of the commonly used MB. You may also want to find the “max_execution_time” variable and set it to something like 300. This will ensure that your site does not time out when uploading larger files. In the end, your values will look like this:
memory_limit = 56M
upload_max_filesize = 56M
post_max_size = 56M
max_execution_time = 300
Though these values will be scattered throughout the file. When you are done, save your file, and drag it back to the directory where your php.ini file is located and overwrite the existing file. It may take a little while for these changes to take effect. If you are on a dedicated server and are able to, you should try restarting your server. If you’re unclear about how to restart your server, check with your web host. Otherwise, make sure your browser and site’s cache is cleared. Hopefully, when you visit Media -> Add New you will see a new maximum upload size, and you’ll be all set.
method 3 create and upload your own php.ini
this applies in a case where you are unable to locate the file in your file manager.you should ftp into your cpanel or use file manager,create a new file and paste the following lines of code in.
memory_limit = 56M
upload_max_filesize = 56M
post_max_size = 56M
file_uploads = On
max_execution_time = 300
method 4 modifying your .htaccess
Update Your .htaccess file

If your web server is using Apache and PHP is set as an Apache module, then you can add a few lines of code in your WordPress .htaccess file to increase the max upload size in WordPress.

To access your .htaccess file, connect to your server via FTP client and navigate to the folder where WordPress is installed. Open up .htaccess file in a code editor or Notepad and add the following lines.

php_value upload_max_filesize 56M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300
This will define the max upload size in Megabytes. Replace the numbers as per your requirement. The max execution time and max input time are in seconds. The execution time defines the limit of time spent on a single script. Choose a number that is suitable for your site
method six create a .user.ini file
if method three above does not work for you,just save the same settings and rename the file to .user.ini.
method 7 try word press plugin
here’s another luck to wordpress users. search and download the wordpress plugin maximum upload size in the wordpress plugins directory. download the plugin, check in your settings and you’ll see a supposed end to your your problems.
method seven contact your hosting provider
finally the last resort,contact your hosting provider and ask them to increase your maximum file upload size limit.
hope this helps, good luck.

About Post Author

CAESAR

THERE IS A TIDE IN THE AFFAIRS OF MEN..
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

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