简体   繁体   中英

Cannot increase maximum upload file size in local WordPress i I tried all ways still showing Maximum upload file size: 2 MB

I am using my own localhost (Cetos 8) for running wordpress 5.4. I want to increase maximum upload file size. I tried these ways but didn't solve:

change data in vi /etc/php.ini .

upload_max_filesize = 1000M
memory_limit = 1000M
post_max_size = 999M
max_execution_time = 6000

2 Step:-changing .htaccess in /var/www/html .

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /your_site_name/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /your_site_name/index.php [L]
</IfModule>

# END WordPress
    # WP Maximum Execution Time Exceeded
    <IfModule mod_php7.c>
    php_value max_execution_time 300

    php_value upload_max_filesize 9000M
    php_value post_max_size 9999M
    php_value max_input_time 300

    </IfModule>

3.adding these line of codes in functions.php file in the theme folder:

@ini_set('upload_max_size' , '512M');
@ini_set('post_max_size', '512M');
@ini_set('max_execution_time', '300');

i used plugin too but didn't get any helped. still showing

Maximum upload file size: 2 MB.

please help if you know how to solve this problem.

In /etc/php.ini file change below values as per your requirement and restart the apache

upload_max_filesize = 10M
post_max_size = 10M

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