Enabling Zend Guard Loader for PHP 5.4, 5.3, or Zend Optimizer for PHP 5.2

Some PHP scripts and apps require the Zend Guard Loader or Zend Optimizer to be able to run, as their code has been encoded either to obfuscate reverse-engineering or to be licensed.

Normally, to install and use Zend Guard Loader or Zend Optimizer (to decode obfuscated PHP code, or run licensed scripts) you would need to: locate and download the proper package, match it to your PHP version and build type, and configure php.ini to set up and load the extension. Otherwise, an error message similar to “Zend Optimizer | Zend Guard Loader not loaded or installed” will be shown, such as this one:

PHP extension “Zend Optimizer” or “Zend Guard Loader” is not loaded. The required run-time support is not installed or properly configured to run PHP scripts encoded by Zend Encoder and Zend Guard.

Installing and enabling Zend Guard Loader and Zend Optimizer is made easy with WampDeveloper Pro, which includes the last good version of each Loader, their full configuration, and their matching PHP versions and types:

  1. Zend Guard Loader for PHP 5.4 and 5.3 FCGI.
  2. Zend Optimizer (Loader) for PHP 5.2 Regular.

Zend Guard Loader for PHP 5.4 and 5.3 FCGI

The last version of Zend Guard Loader released was v3.3, and it was released for PHP 5.4 and 5.3 FCGI only (e.g., there is no “Thread Safe” build for regular PHP).

1. In WampDeveloper’s Components Tab, click the link to download the latest PHP 5.4 or 5.3 FCGI version, and extract the ZIP into folder:
C:\WamDeveloper\Versions\Php\

2. Open and edit (via notepad) PHP 5.4’s or 5.3’s php.ini file:
C:\WampDeveloper\Config\Php\php-54.ini
C:\WampDeveloper\Config\Php\php-53.ini

Near the bottom, find section “[ZendGuardLoader]“, un-comment it as such:

[ZendGaurdLoader]
; ONLY PROVIDED UNDER PHP-FCGI
; MUST BE LOADED AFTER Ioncube, AND BEFORE XDebug
zend_extension="C:\WampDeveloper\Components\Php\ext\ZendLoader.dll"
zend_loader.enable=1
zend_loader.obfuscation_level_support=3
zend_loader.license_path=

Save file.

3. In WampDeveloper's Components Tab, select PHP's 5.4 and 5.3 Subscription Channel:

Channel:  Stable
Bits:     32
PHP Type: FCGI

Then check-mark to use the proper Apache, PHP (FCGI), and MySQL versions. And click: "Switch To Selected Versions".

4. After starting Apache, check the http://serverhost/phpinfo.php page:
with-zend-guard-loader-php-53-fcgi

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

zend-guard-loader-php-53-fcgi

Zend Guard Loader

Zend Guard Loader    enabled
License Path         no value
Obfuscation level    3

Zend Optimizer (Loader) for PHP 5.2

The last version of Zend Optimizer (Loader) released was v3.3.3, and it was released for PHP 5.2 (TS/non-FCGI) only (i.e., the "Not Thread Safe" extension for PHP-FCGI was not released).

1. In WampDeveloper's Components Tab, click the link to download the latest PHP 5.2 Regular version, and extract the ZIP into folder:
C:\WamDeveloper\Versions\Php\

2. Open and edit (via notepad) PHP 5.2's php.ini file:
C:\WampDeveloper\Config\Php\php-52.ini

Near the bottom, find section "[Zend Optimizer]", it should already be un-commented as such:

[Zend Optimizer]
; this will make Apache crash/unstable if used with APC
zend_extension_ts="C:\WampDeveloper\Components\Php\ext\ZendOptimizer.dll"
zend_optimizer.optimization_level=0
zend_optimizer.enable_loader=1

Save file (if you made any changes).

3. In WampDeveloper's Components Tab, select PHP 5.2's Subscription Channel:

Channel:  Legacy-PHP52
Bits:     32
PHP Type: Regular

Then check-mark to use the proper Apache, PHP (FCGI), and MySQL versions. And click: "Switch To Selected Versions".

4. After starting Apache, check the http://serverhost/phpinfo.php page:
with-zend-optimizer-loader-php-52

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

zend-optimizer-loader-php-52

Zend Optimizer

Optimization Pass 1     disabled
Optimization Pass 2     disabled
Optimization Pass 3     disabled
Optimization Pass 4     disabled
Optimization Pass 9     disabled
Zend Loader             enabled
License Path            no value
Obfuscation level       3

Zend Optimizer's "optimization" has been disabled, as we only want its "decoding" (loader) part.

Update: Zend Guard Loader for PHP 5.5 and 5.6, 32 bit and 64 bit

Zend has released newer versions of the Zend Guard Loader for PHP 5.5 and 5.6, including for 64 bit builds of PHP:
Zend Guard Loader Downloads
Installing Zend Guard Loader

The instructions are the same as above, you just need to download the newer version of Zend Guard Loader and match it to its build / PHP version, type, bits.

Note that you can only run a encoded script under the same Zend Guard Loader and PHP version it was encoded for... You are not going to be able to run a Zend Guard Loader 3.3 + PHP 5.3 script under Zend Guard Loader 7.0 + PHP 5.6.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>