简体   繁体   中英

Wordpres Error, CentOs server: The uploaded file exceeds the upload_max_filesize directive in php.ini

I've installed the last version of wordpress Centos Server, when tried to install a plugin I got the following error "The uploaded file exceeds the upload_max_filesize directive in php.ini ".

I tried to modify php.ini and wp-config-sample.php following some tutorials, but I still can't upload something more than 2 MB. Any advice would be welcome.

you can confirm the status of your php setup using phpinfo(); more details about this can be found here http://php.net/manual/en/function.phpinfo.php

There are three places where you could make the change, where you need to apply the change the value depends on where it is set, also you will need to make sure post_max_size is set the same or higher

.htaccess - https://www.a2hosting.co.uk/kb/developer-corner/php/using-php-directives-in-custom-htaccess-files/setting-the-php-maximum-upload-file-size-in-an-htaccess-file

php.ini - https://www.inmotionhosting.com/support/website/php/increase-the-max-file-upload-size-in-php-ini

you can also try this from within your themes functions.php by using

@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');

I hope this helps,

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