[web] Compiled Scripts

Started by
11 comments, last by Etnu 18 years, 11 months ago
Can someone inform me about Compiled Webscripts. I'm seeking a way to hide PHP source code from the server by using PHP compiled into binary. Is this possible? What other solutions are (not necessarily PHP) there?
Advertisement
anything that can be run on most unix systems if you use apache.

That means anything like perl, python, binaries (C++) .etc as long as it is in the cgi-bin directory and you have the interpreter.

Don't forget to output "content-type:text/html\n\n" before your html though.

#!/bin/shecho -en "content-type:text/html\n\n";echo -en "<p>Hello, World</p>"


http://localhost/cgi-bin/hello
There are a couple popular methods using php. One is Zend the other is Ion Cube. I've never used either on my own code but I've used Zend applications before. I can't speak for speed increases but if you're just looking to hide code either should work fine.
Zend has a product called Zend Encoder that accomplishes this. The server needs to have Zend Optimizer installed.
Free Mac Mini (I know, I'm a tool)
Hmm.. I was more of hoping to find something like this:
<?phpinclude_compiled("functions.phpc");functions_cool();?>


Perhaps there is a scripting language that can be bound with PHP?
Quote:Original post by Pipo DeClown
Hmm.. I was more of hoping to find something like this:*** Source Snippet Removed ***

Perhaps there is a scripting language that can be bound with PHP?


With Zend you have to have the Zend optimizer installed on the server then the compiled files act just like regular php file and can be included like normal. The problem however is the price! If you want to use it directly from php like a normal function call you could look into writing your own php extension (overkill) or look for some more compiler options. I haven't found anything free yet but you might want to check out Source Guardian which is considerably cheaper then Zend Encoder.
Hiding PHP's scource code is simply not possible without some kind of application installed that sits between the script and PHP itself... such as the Zend Optimiser or various other script cachers. I've heared good things about MM Chache though.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

The PHP bytecode compiler is what you're looking for. Although it's still an 'experimental' extension it works great. With a bit of luck it will be incorporated as a standard extension in a future PHP version.

Other than that mmcache (now eAccelerator) will do the trick.
Thanks for all the resources.. But there isn't much I can do with the servers my clients are on.
Quote:Original post by Pipo DeClown
Thanks for all the resources.. But there isn't much I can do with the servers my clients are on.


Sounds like the only option with PHP then would be the Zend encoder which most servers have installed by default. Worth a look. Too bad it's so expensive.

This topic is closed to new replies.

Advertisement