> ## Content Index
> Fetch the complete content index at: https://yinguobing.com/blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# 增加wordpress上传文件大小上限
- URL: https://yinguobing.com/blog/wordpress-large-file-uploading/
- Published: 2012-08-11T20:38:05.000Z
- Updated: 2022-05-29T07:22:39.000Z
- Description: 如何在WordPress中上传大文件。
- Author: 尹国冰
- Tags: 生活故事

## 方法一：

在wordpress的functions.php中添加如下代码：

```
@ini_set( ‘upload_max_size’ , ’64M’ );  
@ini_set( ‘post_max_size’, ’64M’);  
@ini_set( ‘max_execution_time’, ‘300’ );

```

## 方法二：

在wordpress的根目录（如果你的wordpress安装在根目录的话）新建一个php.ini文件，添加如下代码：

```
upload_max_filesize = 64M  
post_max_size = 64M  
max_execution_time = 300

```

## 方法三：

使用.htaccess文件，在文件中添加如下代码：

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

```