English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

What I would like to do is take a simple PHP file such as something like:






$myvar = "Hello World";

echo $myvar;

?>




And compile it so that it is in an .exe file? Can I do this so that it is cross platform?: I would like to take this .exe file, place it on a server in a folder and then if the server has PHP installed it could then execute it. I know there are a few free programs to do it but I would like to know of a compiler that is trustworthy and could do this efficiently.
Also I would like to be able to do the same with JavaScript. Any suggestions, ideas or good tutorials?

Thanks,

Brian

2007-03-07 14:23:10 · 7 answers · asked by Brian D 1 in Computers & Internet Programming & Design

7 answers

Technically, no. You can distribute the PHP binary package along with your PHP code, and that can be executed on the client machine. But you cannot package the PHP code by itself - it requires the binaries to interpret and execute the PHP commands. PHP itself is not compiled, it is interpreted.

As far as JavaScript, that's just a big no. On Mac OSX and Windows Vista, you can create widgets and gadgets (respectively) which are essentially little web pages that can run JS and sit on the desktop, but that's about it.

2007-03-07 14:34:15 · answer #1 · answered by Rex M 6 · 0 0

PHP is a cross platform. You write a php file for windows based IIS running PHP. And this file will work, without any change in code, on all other operating systems running any web server with PHP installed.

2007-03-07 19:43:29 · answer #2 · answered by Atif Majid 3 · 0 0

No. PHP and JavaScript are both interpreted languages, you can't compile them. You could make a self-extracting package, and maybe write a deployment script that searches for a PHP installation before extracting. You can't do that with JavaScript because it just won't run outside a browser.

2007-03-07 15:08:53 · answer #3 · answered by abram.kelly 4 · 0 0

Compiling is not cross platform, per definition. You compile for one platform at a time. For example, you can compile a program so it runs on Windows or so that it runs on Linux. It's impossible (AFAIK) to compile for both platforms in a single executable.

However, after some quick googling I found some apps which let you "compile" your script into a Windows executable. There'll probably be similar apps for other platforms too.

2007-03-08 03:29:02 · answer #4 · answered by GodBuster 5 · 0 0

with javascript there's only packing or obfuscating.

I use packer http://dean.edwards.name/packer/ real easy and really obfuscated! nobody but an Übergeek could read it! there's a downloadable version too!

with PHP you can do all sorts of zipping hiding or other things but you still have to have an readable text file.

perhaps there is an obfuscater for php!

2007-03-07 15:07:56 · answer #5 · answered by jake cigar™ is retired 7 · 0 0

PHP is not a compileble language,
you need to run the file in the browser after compliteing your code.

2007-03-07 15:17:47 · answer #6 · answered by roshan u 1 · 0 0

yeah you have carried out it and wanna attempt human beings often compiled code record like exe would be unable to be edited without delay in appreciate of its source code yet whether we can use disassembler to verify and alter how a classes(exe) works. one utility of it hacking the trial classes and making it totally working or finished classes bear in concepts disassembler like IDA professional; W32DASM; and that i think of...SoftICE additionally

2016-09-30 09:03:11 · answer #7 · answered by ? 4 · 0 0

fedest.com, questions and answers