简体   繁体   English

有什么方法可以避免从phar文件中取消相位(PHP存档)?

[英]Is there any way to avoid unphar from phar file (PHP Archive)?

There is a nice tool available in php to archive php files in "phar" format to make it easily distribution and installation. php中有一个不错的工具,可以将“ phar”格式的php文件归档,以使其易于分发和安装。 It can make a single "phar" file of the whole php folder. 它可以制作整个php文件夹的单个“ phar”文件。 http://www.php.net/manual/en/intro.phar.php http://www.php.net/manual/en/intro.phar.php

And phar files can be easily "unphar" to its original folder using tools like http://unphar.com 使用诸如http://unphar.com之类的工具,可以轻松地将phar文件“取消固定”到其原始文件夹

Now, my question is that is there any way that we can add some password or random salt while generating phar file so that it can not be unphar easily? 现在,我的问题是,有什么方法可以在生成phar文件时添加一些密码或随机盐,以使它不容易取消相位? My motive is to protect the php script from alteration. 我的动机是保护php脚本免遭更改。

No, you can't prevent users from extracting phar contents. 不,您不能阻止用户提取phar内容。

What you can do is encoding the php files in there (eg with ioncube) or simply minify them, so that they are unreadable. 您可以做的是在其中编码php文件(例如,使用ioncube)或简单地将它们缩小,以使它们不可读。 But all measurements won't protect you from the determined hacker. 但是,所有衡量标准都无法保护您免受坚定的黑客的侵害。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM