簡體   English   中英

無法增加本地 WordPress 中的最大上傳文件大小我嘗試了所有方法仍然顯示最大上傳文件大小:2 MB

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

我正在使用我自己的本地主機(Cetos 8)來運行 wordpress 5.4。 我想增加最大上傳文件大小。 我嘗試了這些方法但沒有解決:

更改vi /etc/php.ini中的數據。

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

2 步驟:- 在/var/www/html中更改.htaccess

# 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.在主題文件夾中的functions.php文件中添加這行代碼:

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

我也使用了插件,但沒有得到任何幫助。 仍然顯示

最大上傳文件大小:2 MB。

如果您知道如何解決此問題,請提供幫助。

在 /etc/php.ini 文件中根據您的要求更改以下值並重新啟動 apache

upload_max_filesize = 10M
post_max_size = 10M

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM