0

I'm getting this error message when I try to run a CMS (MyPortal 2) on my Xampp server 1.7.1:

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. Opening the file with Notepad++ shows the first line:

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. 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.

Also I made sure that the zend_loader is set to 1 in the php.ini file. phpinfo on server screnshot and php.ini file screnshot

I have also tried different Xampp versions: 1.7.1; 1.7; 1.6.8; 1.6.6 -> all of these have Zend optimizer 3.3.3 or 3.3.0 but different php versions. The error is the same. I have also tried with Xampp version 1.5.0 that uses Zend optimizer version 2.2.x. 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.

I also tried switching to 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.

I am running Xampp on Windows 10.

Any help would be greatly appreciated.

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
mat15
  • 1
  • 2

1 Answers1

0

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.


Geek info about xampp, zend and php:

Zend Optimizer is the predecessor of Zend Guard Loader. The last version of Zend Optimizer was made to support php 5.2. Php 5.3, and higher versions, do NOT support zend optimizer anymore, and you should install 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. 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.

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).

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. 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. After intensive googling I came to realize, that I need Zend Guard Loader, in order to test the cms with different versions. So, I decided to try to install php nts. There's a step by step tutorial on how to install a different php version on xampp. I downloaded php 5.5 nts from this PHP archive and followed the tutorial, I mentioned before. I also backed up the php folder, that was already installed, just in case.. you know. Copied the new php folder inside the xampp folder and changed the name to just 'php', so that xampp interprets it correctly. 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. 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. I started xampp and it showed the same error but a little different:

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). 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. I downloaded php 5.3, downloaded zend guard loader 5.5 and that made it work!


Other useful links I used:

mat15
  • 1
  • 2