Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
Who, or what, are you trying to protect the files from? –  David Spillett Feb 18 '10 at 10:35
    

2 Answers 2

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. –  ta.speot.is 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? –  ta.speot.is 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. –  ta.speot.is 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.