I'm after your opinion on the best possible way to protect a PHP file from being edited / stolen. I used to think highly of Ioncube but after some research it doesn't seem very good these days, so I'm looking for the best possible solution. Please let me know that you think!
there are many forms of protection to protect a script, however, all can be broken with the determined one. the best option i have found is to include a file from your server, ( no license) but some sort of a function that makes it work.
put global variables or the entire script in a .inc file and protect it with htaccess. For example: File: .htaccess (hidden file) <Files *.inc.php> Order deny,allow Deny from all Allow from localhost </Files> Code (markup):
@kimilo37; that way you are describing is just to prevent visitors of a site to gain access to certain files... but if you want to secure your sourcecode, ioncube and other encrypting apps are worth looking in to... but 100% secure is nothing!
I don't consider there to be a best, as the overhead isn't worth what little protection is offerred. They are too easily slapped aside, and in general defeat the entire point of using a open specification open delivery interpreted language like PHP in the first place! You want that type of 'protection', use JAVA or maybe an actual compiled language like C.
But making it harder is to anonymize your code, make weird names for functions, classes and params! oh and remove tabs and spaces where possible! most codes don't have the time to rewrite lots of code to make it readable First hit on google is http://www.phpprotect.info/ (obfuscate, sorry my english isn't very great lol)
But they can just copy and paste it into a "beautifier" to make it readable. I would agree with deathshadow - a compiled language such as C, or focus on the support services and upgrades model. Yes, someone can rip you off, but your company should know its code best, can provide the best support and quickest fixes.