简体   繁体   中英

The uploaded file exceeds the upload_max_filesize directive in php.ini error while uploading plugin

When I tried to upload a plugin for my Wordpress template in wamp 2.0 I got an error:

The uploaded file exceeds the upload_max_filesize directive in php.ini

How to fix this error?

Seeing as though you've mentioned WAMP, I'm going to assume you can edit the php.ini file?

If you left click on the WAMP icon in the status bar, select the PHP menu and then click on the php.ini file in that menu. Just open it in Notepad is fine.

Then in Notepad, do a search (CTRL+F) for "upload_max_filesize", and then you can change the value that is set there.

I don't remember what the default is, but for mine, I have it set to "200M" (without the quotes). This means 200mb.

Save the file, close it, and then restart WAMP.

You should then be right to upload your plugin

In Wamp > PHP > php.ini file, put or edit these lines, and then restart your Wamp server.

post_max_size = 750M 
upload_max_filesize = 750M 
max_execution_time = 5000
max_input_time = 5000  
memory_limit = 1000M

We have seen this error at least once if we have used WordPress.When installing a theme, plugin or uploading an image or file, It has nothing to do with the theme or plugin. The issue is with our server settings which limit the maximum size for uploaded files.

It's a common error and it can be easily fixed. This error message is an indication of that the file you are trying to upload is larger than your web host allows (WordPress default file upload size is 2 MB).

The uploaded file exceeds the upload_max_filesize directive in php.ini

Solution:

A solution is easy, need to increase the file size upload limit.

If using WordPress on a local machine using XAMPP, we will find the php.ini in the following locations. Windows: C:/xampp/php/php.ini

Open the php.ini file. Find these lines in the php.ini file and replace it following numbers

upload_max_filesize = 64M

Save the changes and refresh your website and try uploading the file again. You will now get success.

This error is because your upload_max_filesize variable in php.ini file is adjusted to 2Mb.. change it to 64Mb!! This video tutorial will help you fixing your error in 60 seconds!! Hope it helps

Find this line in the php.ini file upload_max_filesize = 2M and replace it with a higher value (eg upload_max_filesize = 64M )

And restart wamp..!

I use MAMP. To locate the 'php.ini' file, if you also use MAMP, the way Is as follows:

  1. Go to the folder location where the MAMP is installed. For example, 'C:\\MAMP' Is the folder location of MAMP.
  2. Go to 'conf' folder.
  3. From 'localhost:8888/MAMP', you will get 'phpinfo' link under PHP section. Click on the link and from the directed page, get the version of PHP is installed into your system.
  4. From 'conf' folder, go to the folder with the version of PHP you got in the previous step.
  5. Go to that folder and you will get the required php.ini file.
  6. Open that file in any text editor and update the info: (memory_limit = 64M, upload_max_filesize = 128M, post_max_size = 512M)
  7. Restart MAMP. Then you are good to go for uploading big files into your local server.

A Solution is easy, you just want to add plugin in your WordPress .

  1. Download your .zip file of plugin.
  2. Extract the .zip file.
  3. Now, upload the extracted folder to ../wp-content/plugins/ location.
  4. Go to the Installed Plugins page in WordPress , Now you can see the plugin is there, which you have recently uploaded.
  5. Finally, click activate link.

Open your xampp software and click on config button in front of apache option and select php.ini option

Next find this code

upload_max_filesize=2M

and replace with this code

upload_max_filesize=64M

Now restart apache and mysql and enjoy it

If you're using WAMP 2 you should update to Release 3.2.3.x with the GUI you can set upload_max_filesize to 64MB recommended to do so follow the instructions.

  1. Click WAMP icon at taskbar
  2. Go to PHP
  3. PHP Settings
  4. Find "upload_max_filesize" and select the size

Locate the php.ini file in your local dir. I use Xampp. =>C:\\Xampp. Now find the line where it says

upload_max_filesize = 2M

and change this to your desired value.

upload_max_filesize = 56M

Restart all your services and you should be able to upload your new files.

Windows:C:/xampp/htdocs/wordpress_project/.htaccess php_value upload_max_filesize 1000M php_value post_max_size 2000M php_value memory_limit 3000M php_value max_execution_time 180 php_value max_input_time 180 //在wordpress的结束标记中

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM