Any way to get Zend Guard Loader (php 5.3) to execute scripts protected with zendenc52.exe

4.4k views Asked by At

Currently PHP 5.3 hosting environments have to install and use "Zend Guard Loader" extension to process and execute Zend Guard encoded files. I was unable to make it execute files that were encoded for use with Zend Optimizer (PHP 5.2).

Any workaround for this?

3

There are 3 answers

0
AudioBubble On BEST ANSWER

The only way that worked for me was to include php 5.2 file instead of Zend Guards message that is displayed when no zend guard loader found with if condition checking php version. Dirty, but working, yet 2 files still required to be present, but no need to have loader switching them in unprotected code.

7
iWantSimpleLife On

I don't think so... I am also stuck with using php 5.2 because of that.

If you want to run zend encoded 5.2 scripts using "Zend Guard Loader", you will need to fork out more money and buy the new version to encode the scripts again.... sad.

1
Zvika Dror On

To answer the Encoding vs. Runtime in Zend Guard/Optimizer/Loader context - they should perfectly match. The accepted answer is incorrect - there is no tweak to execute PHP 5.3 encoded files in Optimizer loaded in PHP 5.2.

Maintaining 2 target versions is very easy if you script / batch your encoding process when you have code updates. You just execute your source encoding once with zendenc52 and then with zendenc53, giving them different target directories.

More about that. PHP 5.3 code is different from 5.2, and you should actually have 2 different branches for your sources matching those versions. Old News: http://php.net/manual/en/migration53.php

When testing / staging a Zend Guard encoded application, make sure you test the encoded version (and debug the open sources of course as needed). The reason is simple - encoded files have some overhead of data tables which handles obfuscation, and might change PHP functionality with some advanced PHP syntax. If any issue is found in encoded files while testing - it is easy to locate and fix the source. If you test only the source version and then encode and deploy to your customers - result is unpredictable.

As for deployment, when you install/untar/git/svn deploy your PHP files, you can either stick the PHP target version to your releases / downloads / code pushes, so they install in the correct version, or deploy 2 versions in different document root locations, and you can symlink / rewrite to the correct Guarded application version matching the PHP target version 5.2 or 5.3.

Last but not least. The supported runtime for Zend Guard is Zend Server. It has a community edition and anyone can install it free of charge (or purchase licensed components if needed extra boost and monitoring) on supported OSs, via native package managers for DEB / RPM or installation file (Windows, Mac, Other Linuxes not supported with native package managers). Zend Server optional Loader component will handle the encoded application files, and it comes with PHP 5.2 and 5.3 branches, so there is no need to manually install Zend Optimizer or Loader on your PHP. Upgrade from PHP 5.2 to 5.3 is easy and native when applications (encoded and open source) were properly migrated.

Hope this helps.