How to encrypt or hide php code?

Member Avatar

Why? php code is run before it hits the client, so it can't be seen anyway. OR are you developing some stuff for users to download? If you're going open source - no need to encrypt. Are you selling your stuff?

It depends entirely on how you want to hide it. if people will be viewing your source, Then I use external classes that they cannot access, such as how the php pear system works

Usually, as Ardav says, visitors cannot even see your PHP code. Have you ever tried right clicking a website -> view source? Do you see PHP code there? :) (If that's what you mean).

PHP code is not visible to the end user. It can only viewed if you have administrative rights to the server but otherwise, you can not. The reason
behind that is because php is a server side scripting language.

Hope that will help

Member Avatar

IMO, you'd need to have produced something pretty special to warrant PHP encoding and obfuscation.

I wonder if ppl can break into the site but not only stealing information while data are transferred between websites and server?

Yes, there's always a risk that someone breaks into the server and steals your code. Not only do they now have your IP, but also potentially passwords (to databases) etc.

You can encrypt your PHP code so that it's unreadable.