Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to protect files from intruders without encrypting it? Specifically php files. Because when I try to encrypt it , it won't be readable from the localhost. Even a simple application that will hide the local disk will do. But if you know other ways on how to protect files without encrypting then please tell.

share|improve this question
Who, or what, are you trying to protect the files from? – David Spillett Feb 18 '10 at 10:35
up vote 3 down vote accepted

Set up correct permissions on your file system.

It's probably not that hard to set the permissions of your php files so that only the webserver can get to them. This of course means that no one else should have admin/root privileges on that computer.

share|improve this answer
Some account has to be admin, if that account is compromised then the attacks can get to the files. There's no "Everybody that isn't me" security group available in any operating system. What if the attack is remote code injection, that causes httpd to launch a process? The process will have the same access as httpd. – Feb 19 '10 at 0:30
@taspeotis - Or someone could hit him with a rubber hose until he provides the source code. I assume we are talking about reasonable security threats. He only asked about how to protect some of his php code, not how to secure a computer in general. But if You have a better answer please provide it. – Nifle Feb 19 '10 at 10:31
I did, he can compile his PHP source. And how is a remote code execution exploit not considered reasonable? – Feb 19 '10 at 12:49
@taspeotis - Because of the level of threat, If you follow the link in the Rob posted above in a comment you can read that he wants to stop someone on his team from stealing his code. Compiling it will of cource stop someone copying your code. So I retract part of my earlier comment and agree that Compiling your PHP code will also protect your sourcecode (to a degree, there is always disassemblers) – Nifle Feb 19 '10 at 18:29
Note the question mark at the end of Rob's post. This question was asked by user23950, the other question was asked by user225269. Are they the same person? One as been a member for 43 days days, the other 60 days plus. – Feb 19 '10 at 22:49

If you are worried about hackers stealing your source code you can compile your PHP files with Zend Studio.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .