This section contains Frequently Asked Questions and answers regarding encoding and encoded files. Additional FAQ and Support can be obtained at the Zend Website (www.zend.com).
Will using encoded files (instead of source files) change run-time speed or file size?
When I try to run an encoded file, error messages are displayed. Why?
Can Zend Intermediate Code files be de-coded back into the PHP source file?
Do my clients need to install anything to run Zend-encoded files?
My scripts use "include_path" or "auto_prepend". Can I encode them without modification?
Can encoded and non-encoded PHP files be used together?
Yes. Encoded and non-encoded PHP files, in most instances, can be used together transparently. The only exception is files which were encoded using the ”Work Exclusively with Encoded Files” option. These files will only work with encoded files that were encoded by the same company.
Obfuscated files however, can have problem running together with non-obfuscated scripts, if functions or classes defined in one script are called from another script. Such scripts should be both obfuscated or both non-obfuscated, or classes or functions that are called across the "obfuscation border" should be exported.
To temporarily replace obfuscated script with non-obfuscated one and you still want to call the functions and classes in the script, you can use zend_runtime_obfuscate() function - however this function may impact performance so it is not recommended as a permanent solution.
Will using encoded files (instead of source files) change run-time speed or file size?
There might be some speed gain because the compilation stage is saved on every run of the script, however, speed improvements, if any, are dependent on the nature of the script.
The size of an encoded file might be somewhat smaller or larger than the source file, but this too is dependent on the nature of the script. The factors that tend to improve run-time speed are not necessarily the same as those that tend to decrease file size.
When I try to run an encoded file, error messages are displayed. Why?
The most common cause of error messages and failure is incompatibility, either with the PHP version, or with the Zend Intermediate Code file (that is, with the version of the Zend Guard that encoded the file). For additional information, see the ”Avoiding Incompatibilities” section in the Zend Optimizer User Guide.
Can Zend Intermediate Code files be de-coded back into the PHP source file?
Obfuscation like encryption can only be decoded using brut-force techniques. Such techniques typically require vast amounts of time and resources to decode obfuscated strings. Furthermore, the longer the obfuscated string is the less realistic it is to decode these strings as the number of possible combinations increases exponentially. Therefore, it is not feasible that Obfuscated files will not be successfully de-coded.
Do my clients need to install anything to run Zend-encoded files?
Yes, they need to install the Zend Optimizer as part of their PHP setup. The Zend Optimizer is available as a freeware download from: http://www.zend.com/products/zend_optimizer.
What if my script is dependent on library file?
Files that are include()’d or require()’d in the script must be present at run time and will not be part of the encoded file. Both the encoded file and the library files should be shipped together. Such files can be either encoded or non-encoded &endash; both file types can be used together transparently.
Note:
If ”Work Exclusively with Encoded Files” is used the library files must also be encoded by the same company.
Keeping certain files as plain text can be useful if you wish to let users customize parts of the application.
However when obfuscating files there may be a problem running non-obfuscated scripts, if functions or classes defined in one script are called from another script. Such scripts should be both obfuscated or both non-obfuscated, or classes or functions that are called across the "obfuscation border" should be exported.
To temporarily replace obfuscated script with non-obfuscated one and you still want to call the functions and classes in the script, you can use zend_runtime_obfuscate() function - however this function may impact performance so it is not recommended as a permanent solution.
My scripts use include_path or auto_prepend. Can I encode them without modification?
Yes. Since each file is encoded separately, all include()’s take place at run-time and therefore, do not interfere with the Zend Guard.
How do I check if a file is encoded?
You can use a PHP script with the API: boolean zend_loader_file_encoded() to check if the file is encoded.
Zend encoded files return = true.
Yes, as long as the Guard license is good for both machines, since the license generator would require a license to run.
Yes, if both Host IDs are allowed in the generated license
Why are certain files are not being encoded?
It could be that your file has the same name as a general pattern in the ignore list. To solve this select the file and in the General settings tab click "Override Project Configuration. This will remove the resource from the list of patterns to ignore. Repeat if other files fall under the same category of the general pattern for example; if the pattern to ignore is 'test*.php' the file 'contest.php' will also be ignored. Alternatively, refine the patterns you want to ignore in the exclude tab.
What Optimizer and PHP version should I use?
Make sure to use the correct Optimizer and PHP versions as follows:
Zend Guard 5.0 with PHP 5.X requires Zend Optimizer 3.3.x and above
Zend Guard 5.0 with PHP 4.X requires Zend Optimizer 2.6+ for encoding only or Zend Optimizer 3.0+ for obfuscation support
PHP Compatibility: supported PHP versions: 4.2.x through 5.2.x