In this article I'll show you about Zend Guard and Zend Optimizer for PHP, which are currently one of the most widely accepted PHP encoding and obfuscation, and PHP performance enhancing products out there.

What is Zend Optimizer?

The Zend Optimizer is a free runtime you can use with files encoded by Zend Guard, it can be simply added as a PHP extension into your current PHP php.ini configuration. Zend Optimizer can help speed up the performance and reduce the server demand of your PHP scripts which have been encoded by Zend Guard.

You can read more about Zend Optimizer via the release notes on Zend.com

What is Zend Guard?

Running Zend Guard on your PHP scripts will help encode your scripts to prevent reverse engineering and unauthorized edits to your code, it will also protect your code from unauthorized use, and you can run Zend Guard encoded scripts through Zend Optimizer (with PHP 5.2 and older) to help enhance the performance of your PHP applications as well.

You can find more information about Zend Guard direct from Zend.com as well.

Am I already using Zend Optimizer or Zend Guard?

You can easily check if your website is already using Zend Optimizer or Zend Guard by viewing your PHP settings using a phpinfo.php page.

ZendOptimzer

If you are running PHP 5.2 or older, you should already have Zend Optimzer enabled, and it should look like this:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

ZendGuard

If you are running PHP 5.3 or newer, you should more than likely already have Zend Guard enabled, and in your phpinfo.php page it should look like this:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

Enable Zend Optimizer

To use Zend Optimizer, you need to be running PHP 5.2 or older. In a lot of cases you would want to use multiple PHP versions on one account with the help of .htaccess rules, so that you can still use Zend Guard to encode your files. On a shared server you'd change the PHP version your account uses. With a VPS or dedicated server you could follow the steps for how to upgrade PHP using EasyApache, and just choose to downgrade instead.

Typically just switching your PHP version should load the proper Zend product, to be sure though, on your phpinfo.php page you should see this in about the 7th field down when you're using PHP 5.2 with Zend Optimizer:

Loaded Configuration File: /opt/php52/lib/php.ini

If you instead see something like:

Loaded Configuration File: /home/userna5/public_html/php.ini

Then you have probably at some point followed our steps for making your php.ini file recursive. In which case, you need to make sure you're editing your /public_html/php.ini file to include the Zend Optimizer includes of:

[Zend]
zend_extension="/opt/php52/lib/php/extensions/no-debug-non-zts-20060613/ZendOptimizer.so"

If you have any problems at all getting Zend Optimizer working on your account please contact technical support for further assistance.

Enable Zend Guard

In order to enable Zend Guard on your server, you first need to be sure you're running PHP 5.3 or newer. If you are on a shared server you can change the PHP version your account uses. If you're on a VPS or dedicated server with root access, you can upgrade PHP using EasyApache if all of your PHP applications can run without PHP 5.2, or simply contact technical support to also have the ability to switch between PHP versions on your server.

Simply switching PHP versions should load the proper Zend product for you, your phpinfo.php page should read this in about the 7th field down when you're using PHP 5.3+ with Zend Guard:

Loaded Configuration File: /usr/local/lib/php.ini

If you instead see something like:

Loaded Configuration File: /home/userna5/public_html/php.ini

You probably at some point followed our steps for making your php.ini file recursive. In which case, you need to make sure you're editing your /public_html/php.ini file to include the Zend Guard includes of:

[Zend]
zend_extension="/usr/local/Zend/lib/Guard-5.5.0/php-5.3.x/ZendGuardLoader.so"

If you have any problems with Zend Guard working on your account please contact technical support for further assistance.

You should now hopefully understand a bit more about Zend Optimizer and Zend Guard and how to get your account setup to be able to take advantage of them!

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!