# [web] Compiled Scripts

This topic is 4778 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
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

##### Share on other sites
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.

##### Share on other sites
Zend has a product called Zend Encoder that accomplishes this. The server needs to have Zend Optimizer installed.

##### Share on other sites
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?

##### Share on other sites
Quote:
 Original post by Pipo DeClownHmm.. 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.

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
Thanks for all the resources.. But there isn't much I can do with the servers my clients are on.

##### Share on other sites
Quote:
 Original post by Pipo DeClownThanks 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.

• 15
• 11
• 9
• 49
• 12
• ### Forum Statistics

• Total Topics
631389
• Total Posts
2999727
×