我可以加密 PHP 源代码或编译它以便其他人看不到它吗? 如何?
我需要加密一些已向公众发布的 PHP 源代码。
这可能吗? PHP可以“编译”吗?
I need to encrypt some PHP source that I've released to the public.
Is this possible? Can PHP be "compiled" ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
您可以购买 Zend Guard 来编码您的 PHP 源代码,然后使用 Zend Optimizer 来运行它。 还有一个开源/免费的 PHP 编译器项目(bcompiler,并且还可以查看 this),但我从未使用过它,因为在我需要它时该项目仍然不完整。
You can buy Zend Guard to encode your PHP sources, and then use the Zend Optimizer to run it. There is an opensource/free PHP compiler project as well (bcompiler, and also take a look to this) but I never used it because at the time I needed it the project was still incomplete.
你可以看看 phc 它可以从 PHP 生成可执行文件。 它还具有一些其他选项,可以从原始 PHP 源代码创建 C 代码、XML、优化的 PHP 等。
You can have a look at phc which can generate executables from PHP. It also has some other options to create C-code, XML, optimized PHP, etc. from the original PHP source.
如果您需要您的代码能够在没有任何模块的 PHP 标准版本上运行,那么答案是否定的。 没有一种编译方法可以适用于各种不同的 PHP 安装。
If you need your code to be able to run on a standard version of PHP without any modules then the answer is NO. There is no method of compilation that is going to work on the wide variety of different PHP installations.
Nusphere(PhpED 的制造商)有一款名为 Nu-coder 正是这样做的。 虽然不是免费的,但它会做你想做的。
Nusphere (the makers of PhpED) have a product called Nu-coder for doing exactly this. Although not free, it will do what you want.
ioncube 和 zend 的问题——
它们都是可破解的,并且有一些花费大约 500 美元的应用程序可以让你窃取代码。
它们都需要加载程序才能运行 - 为什么你会问这是一个问题? 如果这个项目要向公众出售,那么您肯定会收到大量有关 ioncube 的技术支持问题,我不需要告诉您支持别人的代码/软件是什么感觉。
我发现在这种情况下,两者都不是一个好的选择。
the problem with ioncube and zend --
They BOTH are crackable and there are applications out there for around 500.00 bucks that will allow you to steal the code.
They BOTH need loaders to run - why you ask is this a problem? IF this project is to be sold to the public then you will without fail get a ton of tech support questions about ioncube and I don't need to tell you what it's like supporting someone else's code / software.
I've found in this case neither one is a good choice.
我想说也可以尝试一下 ionCube - 他们是 PHP 编码软件历史最悠久、最成功的创建者之一。 我们将它们用于我们的 Web 开发项目,虽然需要安装“加载器”是一个缺点,但它们现在提供加载器向导脚本,我们将其捆绑给用户,并为他们提供逐步说明。
另外,我一直发现他们的支持非常有帮助:)
I would say try ionCube also - they're one of the longest established and successful creators of PHP Encoding software. We use them for our Web development projects and while the need to install a "Loader" is a bit of a downside, they now provide the Loader Wizard script which we bundle to users and it gives them step by step instructions.
Also, I've always found their support to be more than helpful :)
有一些软件可用于加密 PHP 源代码以保护知识产权。 不过,我不知道有什么免费的。 如果您同意付费/共享软件,只需谷歌搜索“php 加密源”之类的内容即可。
There is some of software available to encrypt PHP sources to protect intellectual property. I do not know any free ones, though. Just google something like "php encrypt source" if you're ok with paying/shareware.