任何让 Zend Guard Loader (php 5.3) 执行受 zendenc52.exe 保护的脚本的方法
目前 PHP 5.3 托管环境必须安装并使用“Zend Guard Loader”扩展来处理和执行 Zend Guard 编码文件。我无法让它执行为与 Zend Optimizer (PHP 5.2) 一起使用而编码的文件。
有什么解决方法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不这么认为...因此我也坚持使用 php 5.2。
如果你想使用“Zend Guard Loader”运行 zend 编码的 5.2 脚本,你将需要花更多的钱并购买新版本来再次编码脚本......悲伤。
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.
对我有用的唯一方法是包含 php 5.2 文件,而不是当没有使用 if 条件检查 php 版本找到 zend Guard 加载程序时显示的 Zend Guards 消息。虽然脏,但可以工作,但仍然需要存在 2 个文件,但不需要让加载程序在不受保护的代码中切换它们。
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.
要回答 Zend Guard/Optimizer/Loader 上下文中的编码与运行时 - 它们应该完全匹配。接受的答案是不正确的 - 在 PHP 5.2 中加载的优化器中没有执行 PHP 5.3 编码文件的调整。
如果您在有代码更新时编写/批处理编码过程,则维护 2 个目标版本非常容易。您只需使用 zendenc52 执行一次源编码,然后使用 zendenc53 执行一次,为它们提供不同的目标目录。
更多相关内容。 PHP 5.3 代码与 5.2 不同,您实际上应该有 2 个不同的分支来匹配这些版本的源代码。
旧新闻: http://php.net/manual/en/migration53.php
何时测试/暂存 Zend Guard 编码的应用程序,请确保测试编码版本(当然还可以根据需要调试开源)。原因很简单 - 编码文件有一些处理混淆的数据表开销,并且可能会使用一些高级 PHP 语法更改 PHP 功能。如果在测试时在编码文件中发现任何问题 - 很容易找到并修复源。如果您仅测试源版本,然后编码并部署给您的客户 - 结果是不可预测的。
至于部署,当您安装/untar/git/svn部署您的PHP文件时,您可以将PHP目标版本粘贴到您的发布/下载/代码推送中,以便它们安装在正确的版本中,或者在不同的文档中部署2个版本根位置,并且您可以符号链接/重写到与 PHP 目标版本 5.2 或 5.3 匹配的正确受保护的应用程序版本。
最后但并非最不重要的。 Zend Guard 支持的运行时是 Zend Server。它有一个社区版本,任何人都可以通过 DEB / RPM 的本机包管理器或安装文件(Windows、Mac、不支持的其他 Linux)在支持的操作系统上免费安装它(或者购买许可组件,如果需要额外的增强和监控)本机包管理器)。 Zend Server 可选的 Loader 组件将处理编码的应用程序文件,并且它附带 PHP 5.2 和 5.3 分支,因此无需在 PHP 上手动安装 Zend Optimizer 或 Loader。当应用程序(编码和开源)正确迁移时,从 PHP 5.2 升级到 5.3 是简单且原生的。
希望这有帮助。
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.