Reputation: 1606
There is a nice tool available in php to archive php files in "phar" format to make it easily distribution and installation. It can make a single "phar" file of the whole php folder. 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
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? My motive is to protect the php script from alteration.
Upvotes: 0
Views: 1057
Reputation: 31078
No, you can't prevent users from extracting phar contents.
What you can do is encoding the php files in there (e.g. with ioncube) or simply minify them, so that they are unreadable. But all measurements won't protect you from the determined hacker.
Upvotes: 1