简体   繁体   English

编码文件的格式主要 ID 为 65540,而优化器预计为 2

[英]The encoded file has format major ID 65540, whereas the Optimizer expects 2

I'm getting this error message when I try to run a CMS ( MyPortal 2 ) on my Xampp server 1.7.1:当我尝试在我的 Xampp 服务器 1.7.1 上运行 CMS ( MyPortal 2 ) 时收到此错误消息:

Incompatible file format: The encoded file has format major ID 65540, whereas the Optimizer expects 2 in C:\xampp\htdocs\mp2.32-5.3\index.php on line 0

I assume that the source project is encoded with the Zend Guard.我假设源项目是用 Zend Guard 编码的。 Opening the file with Notepad++ shows the first line:使用 Notepad++ 打开文件显示第一行:

Zend 2004072203 65540 24625 95846

I know I am using the correct php, because on the site it says, that the requirement is php 5.2.1 OR NEWER.我知道我使用的是正确的 php,因为它在网站上说,要求是 php 5.2.1 或更新版本。 Xampp 1.7.1 has php 5.2.9 and zend optimizer 3.3.3 shipped with it, as you can see on this screenshot , that I took from phpinfo. Xampp 1.7.1 具有 php 5.2.9 和 zend 优化器 3.3.3,正如您在此屏幕截图中看到的那样,我从 phpinfo 获取。

Also I made sure that the zend_loader is set to 1 in the php.ini file.我还确保 php.ini 文件中的zend_loader设置为 1。 phpinfo on server screnshot and php.ini file screnshot服务器截图php.ini 文件截图上的 phpinfo

I have also tried different Xampp versions: 1.7.1;我也尝试过不同的 Xampp 版本:1.7.1; 1.7; 1.7; 1.6.8; 1.6.8; 1.6.6 -> all of these have Zend optimizer 3.3.3 or 3.3.0 but different php versions. 1.6.6 -> 所有这些都有 Zend 优化器 3.3.3 或 3.3.0 但不同的 php 版本。 The error is the same.错误是一样的。 I have also tried with Xampp version 1.5.0 that uses Zend optimizer version 2.2.x.我还尝试过使用 Zend 优化器版本 2.2.x 的 Xampp 版本 1.5.0。 I got the exact same result only, instead of Optimizer expects 2 in C:\xampp.... on line 0 , it's a different number other than 0.我只得到了完全相同的结果,而不是Optimizer在第 0 行的 C:\xampp.... 中期望 2 ,它是一个不同于 0 的数字。

I also tried switching to Wamp.我也尝试切换到 Wamp。 I got the EXACT same error.我得到了完全相同的错误。

However, I have not tried installing the Zend Guard Loader because both Xampp and Wamp use php with thread safe on, whereas the Zend Guard Loader requires php to be nts.但是,我没有尝试安装 Zend Guard Loader,因为 Xampp 和 Wamp 都使用 php 并开启线程安全,而 Zend Guard Loader 需要 ZE1BFD762321E409CEE4AC0B6E841963nt

I am running Xampp on Windows 10.我在 Windows 10 上运行 Xampp。

Any help would be greatly appreciated.任何帮助将不胜感激。

I solved it, if anyone is interested.我解决了,如果有人感兴趣的话。

In short, the CMS I tried to install on my Xampp was encoded with Zend Guard 5.5 using php 5.3 NTS .简而言之,我尝试在 Xampp 上安装的 CMS 是使用 Zend Guard 5.5 使用 php 5.3 NTS编码的。


Geek info about xampp , zend and php :关于xamppzendphp的极客信息:

Zend Optimizer is the predecessor of Zend Guard Loader. Zend Optimizer 是 Zend Guard Loader 的前身。 The last version of Zend Optimizer was made to support php 5.2. Zend Optimizer 的最新版本支持 php 5.2。 Php 5.3, and higher versions, do NOT support zend optimizer anymore, and you should install Zend Guard Loader. Php 5.3 及更高版本不再支持 zend 优化器,您应该安装 Zend Guard Loader。 Xampp v 1.7.1 is the last version to support Zend Optimizer (v3.3.3) as it has php 5.2.9. Xampp v 1.7.1 是支持 Zend Optimizer (v3.3.3) 的最后一个版本,因为它具有 php 5.2.9。 On the other hand, Xampp v 1.7.2 is using php 5.3.0 and, you guessed it, it does not come with zend opzimiter.另一方面,Xampp v 1.7.2 使用的是 php 5.3.0,而且,您猜对了,它没有附带 zend opzimiter。

Also, fun fact: the php, that xampp is shipped with, is thread safe, whereas, if you want to install zend guard loader, you have to install php non thread safe (nts).此外,有趣的事实:xampp 随附的 php 是线程安全的,而如果要安装 zend 保护加载程序,则必须安装 ZE1BFD762321E409CEE4AC0B6E841.963nts

How I did it:我是怎么做到的:

First I tried with Xampp v. 1.7.1, because it had Zend optimizer 3.3.3, with php 5.2 prepacked.首先,我尝试使用 Xampp v. 1.7.1,因为它具有 Zend 优化器 3.3.3,并预装了 php 5.2。 I tried to run it, but it produced the error that is written in the title above.我试图运行它,但它产生了上面标题中写的错误。 So from the error above, you can not really know, what kind of zend loader you need.所以从上面的错误中,你无法真正知道,你需要什么样的 zend loader。 After intensive googling I came to realize, that I need Zend Guard Loader, in order to test the cms with different versions.经过密集的谷歌搜索后,我意识到我需要 Zend Guard Loader 来测试不同版本的 cms。 So, I decided to try to install php nts.所以,我决定尝试安装 php nts。 There's a step by step tutorial on how to install a different php version on xampp.关于如何在 xampp 上安装不同的 php 版本的分步教程 I downloaded php 5.5 nts from this PHP archive and followed the tutorial, I mentioned before.我从这个 PHP 存档下载了 php 5.5 nts 并按照我之前提到的教程进行操作。 I also backed up the php folder, that was already installed, just in case.. you know.我还备份了已经安装的 php 文件夹,以防万一……你知道的。 Copied the new php folder inside the xampp folder and changed the name to just 'php', so that xampp interprets it correctly.复制 xampp 文件夹中的新 php 文件夹并将名称更改为“php”,以便 xampp 正确解释它。 There was also some other stuff I did in the apache folder (I added FastCGI mod_fcgid module and configured the httpd-xampp.conf file) as in the tutorial mentioned.在提到的教程中,我还在 apache 文件夹(我添加了FastCGI mod_fcgid 模块并配置了 httpd-xampp.conf 文件)中做了一些其他的事情。 Then, after setting up the php and testing it with phpinfo, I downloaded zend guard loader 7.0.0 for php 5.5 from here: zend guard loader .然后,在设置 php 并使用 phpinfo 对其进行测试后,我从这里下载了 php 5.5 的 zend guard loader 7.0.0:zend guard loader I started xampp and it showed the same error but a little different:我启动了 xampp,它显示了相同的错误,但略有不同:

Incompatible file format: The encoded file has format major ID 4, whereas the Loader expects 6

This is progress because it tells me that it needs Zend Guard Loader that has Zend Encoder ID 4. It's showing 6, because I had installed Zend Guard Loader 7.0.0 for php 5.5, which has Zend Encoder ID 6. There is a table that shows what php supports which zend guard loader and encoder ID (be aware that in the table Zend Encoder ID 4 requires Zend Guard version 5.5 and NOT version 6).这是一个进步,因为它告诉我它需要 Zend 编码器 ID 4 的 Zend Guard Loader。它显示 6,因为我已经为 php 5.5 安装了 Zend Guard Loader 7.0.0,它的 Zend 编码器 ID 为 6。有一个显示了 php 支持哪些 zend 保护加载器和编码器 ID(请注意,在表中 Zend 编码器 ID 4 需要 Zend Guard 版本 5.5 而不是版本 6)。 From here on it was simple.从这里开始很简单。 The CMS wanted zend guard loader 5.5, that supports zend encoder ID 4 and uses php 5.3. CMS 想要 zend 保护加载程序 5.5,它支持 zend 编码器 ID 4 并使用 php 5.3。 I downloaded php 5.3, downloaded zend guard loader 5.5 and that made it work!我下载了 php 5.3,下载了 Zend Guard loader 5.5,这让它工作了!


Other useful links I used:我使用的其他有用链接:

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

相关问题 致命错误:不兼容的文件格式:编码文件的主要格式为ID 7,而Loader希望使用5 in - Fatal error: Incompatible file format: The encoded file has format major ID 7, whereas the Loader expects 5 in Zend Optimizer 3.3.9出现不兼容的文件格式错误消息 - Incompatible file format error message with Zend Optimizer 3.3.9 这不是文本文件(Zend优化器) - This is not a text file(zend optimizer) 第一个字母如果有重音则会消失(CSV文件,UTF-8编码) - First letter disappear if it has an accent (CSV file, UTF-8 encoded) getElementsByClassName不起作用,而ID起作用。 为什么? - getElementsByClassName is not working whereas ID is working. Why? 用于解码使用 PHPs rawurlencode 编码的字符串的正确 .NET 编码格式是什么? - What is the correct .NET encoding format to use to decode a string that has been encoded using PHPs rawurlencode? html和主要浏览器支持的不同视频格式 - different video format supported by html and major browsers 警告:number_format()期望参数1为double - Warning: number_format() expects parameter 1 to be double 警告:date_format() 期望参数 1 为 DateTime - Warning: date_format() expects parameter 1 to be DateTime money_format()期望参数2为double - money_format() expects parameter 2 to be double
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM