wordpress:增加上传文件限制, How to Increase the Maximum File Upload Size in WordPress

如何查看当前上传文件大小的限制 How to Check Your Maximum File Upload Size Limit in WordPress?

直接看下图:WordPress will automatically show the maximum file upload size limit when you are uploading images or media. To check it you can simply go to Media » Add New page and you will see the maximum file uplaod size limit for your WordPress site.

wordpress:增加上传文件限制, How to Increase the Maximum File Upload Size in WordPress
wordpress:增加上传文件限制, How to Increase the Maximum File Upload Size in WordPress

默认其实是 2MB的上传量,修改的方法如下:

方法1:  修改主题functions.php文件 Theme Functions File

There are cases where we have seen that just by adding the following code in theme’s functions.php file, you can increase the upload size:

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

方法2. 创建或者修改根目录下的php.ini文件 Create or Edit an existing PHP.INI file

In most cases if you are on a shared host, then you will not see a php.ini file in your directory. If you do not see one, then create a file called php.ini and upload it in the root folder. In that file add the following code:

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

如果 60M 不工作的,可以适当调小一点,比如10M,看看可以不可以

方法3. 修改根目录下的 .htaccess文件 htaccess Method

Some people have tried using the .htaccess method where by modifying the .htaccess file in the root directory, you can increase the maximum upload size in WordPress. Edit the .htaccess file in your WordPress site’s root folder and add the following code:

php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300

 

注意:以上三个方法不一定都要修改才有效,也许其中一个就可以解决问题!所以,可以从上之下试试看。

 

本文:wordpress:增加上传文件限制, How to Increase the Maximum File Upload Size in WordPress

Loading

One Comment

Add a Comment

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

Time limit is exhausted. Please reload CAPTCHA.