简体   繁体   English

WHM 无法更改 Wordpress 最大上传大小

[英]WHM Unable to Change Wordpress Max Upload Size

I have several Wordpress installs in a WHM Environment.我在 WHM 环境中安装了几个 Wordpress。 My WHM PHP(5.6) max upload size is set to 100MB & PHP max POST size 150MB.我的 WHM PHP(5.6) 最大上传大小设置为 100MB,PHP 最大 POST 大小设置为 150MB。 I also check MultiPHP INI Editor and the max upload size is the same.我还检查了 MultiPHP INI 编辑器,并且最大上传大小是相同的。 But for some reason all my Wordpress installs have a max upload size of 8MB.但出于某种原因,我所有的 Wordpress 安装的最大上传大小为 8MB。 I cannot get it to change.我不能让它改变。

I've tried the following:我尝试了以下方法:

  • Added php.ini file, but does not help/change添加了 php.ini 文件,但没有帮助/更改
  • Added php code to the .htaccess, but it causes a Internal Server Error向 .htaccess 添加了 php 代码,但它会导致内部服务器错误
  • Added php code to the theme's function.php, but it causes a Internal Sever Error将 php 代码添加到主题的 function.php,但它会导致内部服务器错误
  • Spoke with HostGator customer server for a couple hours and they were not able to help.与 HostGator 客户服务器交谈了几个小时,他们无法提供帮助。

Any ideas?有什么想法吗?

Hi Try to add these lines in your theme functions.php嗨尝试在您的主题functions.php中添加这些行

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

Or verify your php.ini files and change these values或者验证您的 php.ini 文件并更改这些值

upload_max_filesize = 64M
post_max_size = 64M

Or add this in your .htaccess files或将其添加到您的 .htaccess 文件中

php_value upload_max_filesize 64M
php_value post_max_size 64M

You should restart your apache server after changing the php.ini file to take effect on your hosting.您应该在更改 php.ini 文件后重新启动您的 apache 服务器以在您的主机上生效。

If you are using Wordpress multisites you can have a restriction from Wordpress itself you find it under Settings -> Network settings -> Maximum file size如果您使用的是 Wordpress 多站点,则可以从 Wordpress 本身获得限制,您可以在“设置”->“网络设置”->“最大文件大小”下找到它

If you don't want coding, directly increase max upload size through this free plugin https://ziscom.today/max-upload-size/如果你不想编码,直接通过这个免费插件增加最大上传大小https://ziscom.today/max-upload-size/

After installation go to WordPress menu 'Max Upload Size' * Only enter the numeric value in bytes * 1024 bytes = 1KB * 1048576 bytes = 1MB安装后转到 WordPress 菜单“最大上传大小” * 仅输入以字节为单位的数值 * 1024 字节 = 1KB * 1048576 字节 = 1MB

It worked for me.它对我有用。 Hope it help for you.希望对你有帮助。

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

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