Can';在Wordpress中导入Divi布局
正在尝试导入Divi布局(.json文件) 获取此错误:Can';在Wordpress中导入Divi布局,wordpress,wordpress-theming,Wordpress,Wordpress Theming,正在尝试导入Divi布局(.json文件) 获取此错误: This file cannot be imported. It may be caused by file_uploads being disabled in your php.ini. It may also be caused by post_max_size or/and upload_max_filesize being smaller than file selected. Please increase it or t
This file cannot be imported. It may be caused by file_uploads being
disabled in your php.ini. It may also be caused by post_max_size or/and
upload_max_filesize being smaller than file selected. Please increase
it or transfer more substantial data at the time.
但事实并非如此,因为我对两者都没有限制,我可以在WP安装中的任何其他地方上传
有人知道还有什么会导致此错误吗?我的回答与Divi主题版本3.0.46有关 我也有同样的问题,接下来就是我是如何解决的 在我的例子中,错误是从Divi Builder portability.js文件第464行生成的:
var fileSize = Math.ceil( ( data.file.size / ( 1024 * 1024 ) ).toFixed( 2 ) ),
formData = new FormData();
// Max size set on server is exceeded.
if ( fileSize >= $this.postMaxSize || fileSize >= $this.uploadMaxSize ) {
etCore.modalContent( '<p>' + $this.text.maxSizeExceeded + '</p>', false, true, '#' + $this.instance( '.ui-tabs-panel:visible' ).attr( 'id' )\
);
$this.enableActions();
return;
}
因此,解决方案似乎是使您的php上载最大大小和最大帖子大小至少比您尝试上载的文件大1MB
《优雅主题》杂志有一篇很长的帖子:
这和在我的php.ini中设置这个一样简单
; TO have a 31.4MB file upload into Divi, these must be at least 32MB.
post_max_size = 32M
upload_max_filesize = 32M
关于这一点,我想说的最后一件事是,由于此错误是由浏览器中的javascript生成的,因此您必须:
- 更改您的php.ini
- 重新启动Web服务器[至少我需要使用Apache]
- 刷新页面,因为限制缓存在浏览器中,而不是任何ajax调用的结果,等等
- 我也遇到了同样的问题。我在谷歌上搜索并找到了下面的解决方案。(为没有得到正确的解释而道歉!)
解决方案:
使用以下文本创建一个新文件
php.ini
,并保存在网站的根目录中,即可完成
file_uploads = On
upload_max_filesize = 100M
post_max_size = 100M
你要上传的文件有多大?在站点运行的服务器上,您可以使用GUI增加限制,否则,请查找php.ini文件并检查文件上载设置。或者您可以将
.json
文件拆分成更小的文件。添加:是否定义了('WP\u内存限制','256M')
towp config.php
help?这些文件大约有一百万个,就像我说的,没有限制。上传Divi主题本身(1800万没有问题)。
file_uploads = On
upload_max_filesize = 100M
post_max_size = 100M