简体   繁体   English

如何在wordpress中增加我的最大文件上传大小?

[英]How could I increase my maximum file upload size in wordpress?

I am currently using the .htacces method to achive this 我目前正在使用.htacces方法来实现这个目标

Here is what I am using so far 这是我到目前为止使用的

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

But each time I am getting error 但每次我都会收到错误

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request. 服务器遇到内部错误或配置错误,无法完成您的请求。

The better way is to change its settings through php.ini file. 更好的方法是通过php.ini文件更改其设置。 Find/change following options: 查找/更改以下选项:

upload_max_filesize = 100M
post_max_size = 100M

Save this code in any php file and update it in the plugins directory and activate that plugin: 将此代码保存在任何php文件中,并在plugins目录中更新并激活该插件:

ini_set('upload_max_size','256M');
ini_set('post_max_size','256M');
ini_set('max_Execution_time','600');

You can put these lines before or after any other script in you .htaccess file. 您可以在.htaccess文件中的任何其他脚本之前或之后放置这些行。 Save it and upload. 保存并上传。 That's it! 而已! Hope this helps! 希望这可以帮助!

#Change upload limits

php_value memory_limit 34M
php_value post_max_size 33M
php_value upload_max_filesize 32M
php_value max_execution_time 600

#Change upload limits end 

In your php.ini file insert the following lines of code into it if it is not there and increase upload_max_filesize according to your requirements: 在php.ini文件中,如果不存在,请将以下代码行插入其中,并根据您的要求增加upload_max_filesize:

memory_limit = 100M
upload_max_filesize = 200M
post_max_size = 100M
file_uploads = On

Ok great, I just got it!! 好的,我刚刚得到它!

Adding the followwing code in "wp-admin" folder does the trick 在“wp-admin”文件夹中添加followw代码就可以了

memory_limit = 100M
upload_max_filesize = 200M
post_max_size = 100M

As a summary of the above: 作为上述的总结:

I add the following code in the .htaccess file in the directory wp-admin: 我在wp-admin目录中的.htaccess文件中添加以下代码:

php_value memory_limit 34M
php_value post_max_size 33M
php_value upload_max_filesize 32M
php_value max_execution_time 600

and it worked. 它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM