php Wordpress 主题上传错误 PCLZIP_ERR_BAD_FORMAT

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17771578/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:24:21  来源:igfitidea点击:

Wordpress theme upload error PCLZIP_ERR_BAD_FORMAT

phpwordpresswordpress-theming

提问by dShringi

I'm new to php as well as wordpress however because of some need I had to work with wordpress only. So just to start I read a tutorial and created a wordpress theme of my own and when I tried to upload my theme I got the below error:

我是 php 和 wordpress 的新手,但是由于某些需要,我只能使用 wordpress。所以刚开始我阅读了一个教程并创建了我自己的 wordpress 主题,当我尝试上传我的主题时,我收到以下错误:

The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

Searching for the same I've found that usually the cause of such an error is maximum available space or upload file size issue. However since I'm working on localhost I don't think it could be the case. Moreover I've increased the upload_max_filesize, post_max_sizeand memory_limitas well. But still I'm getting the same error.

搜索相同的我发现这种错误的原因通常是最大可用空间或上传文件大小问题。但是,由于我在 localhost 上工作,因此我认为情况并非如此。而且我已经提高了upload_max_filesizepost_max_sizememory_limit也。但我仍然遇到同样的错误。

I'm using Wordpress 3.5.2.

我正在使用 Wordpress 3.5.2。

回答by Ashwin Parmar

This error due to you are trying to upload Other than ZIPCompressed version. Other format is not supported while uploading the plugin in wordpress.

此错误是由于您尝试上传非ZIP压缩版本。在wordpress中上传插件时不支持其他格式。

You should unzip your plugin and make sure you compress with ZIPformat and upload it will be working fine.

您应该解压缩您的插件并确保您使用ZIP格式压缩并上传它会正常工作。

回答by Jeckerson

One of simple alternative is to download theme package, upzip it and upload through FTP whole theme folder into

一种简单的替代方法是下载主题包,将其压缩并通过 FTP 将整个主题文件夹上传到

/wp-content/themes

Then go to Admin CP and switch to new installed theme.

然后转到 Admin CP 并切换到新安装的主题。

回答by user1589375

I had this problem while trying to install Wordpress plugin from the Wordpress interface. Turns out the disk space quota was full for that specific account. I went to WHM manager and increased the quota and the problem was solved.

我在尝试从 Wordpress 界面安装 Wordpress 插件时遇到了这个问题。原来该特定帐户的磁盘空间配额已满。我去了WHM经理并增加了配额,问题就解决了。

回答by Dushyant Singh Yadav

please check that only those file are here that you wan to upload. i was getting same problem, then i search on folder, there was already zip folder in it. after uploading that zip file. the problem was solved. Now the themes is activated.

请检查此处是否只有您要上传的文件。我遇到了同样的问题,然后我搜索文件夹,里面已经有 zip 文件夹了。上传该 zip 文件后。问题解决了。现在主题已激活。

回答by Daniel Jankowski

I had a similar problem when I was installing plugins for a theme. It appeared that in the meantime plugins' download url had changed, updating it solved the problem :)

我在为主题安装插件时遇到了类似的问题。看来在此期间插件的下载 url 已更改,更新它解决了问题:)

回答by Cybersupernova

I found one more case which may help you.

我又找到了一个可能对你有帮助的案例。

It throws the same error if the zip file is incompleteor corrupt.

如果 zip 文件是incomplete或 ,它会抛出相同的错误corrupt

回答by graphypro

This is because you are uploading the theme as a ".rar" file.

这是因为您将主题上传为“.rar”文件。

Convert the theme into ".zip" file and then upload it to your site.

将主题转换为“.zip”文件,然后将其上传到您的网站。

For converting into the ".zip":

转换为“.zip”:

  1. Right-click on the folder of your theme folder.

  2. Select "Send to".

  3. Click on "Compressed (zipped) folder".

  4. Upload ".zip" file to your WordPress site.

  1. 右键单击主题文件夹的文件夹。

  2. 选择“发送到”。

  3. 单击“压缩(zipped)文件夹”。

  4. 将“.zip”文件上传到您的 WordPress 网站。