views:

187

answers:

3

I have a command line php app that I need to distribute to a client. I just want to give them an executable, not instructions for installing php ;)

What is a good php compiler for windows that includes support for php 5, curl, TLS, and a few other libs I use?

I need to control memory and time limit usage, so I must be able to use a custom php.ini. (this should be packaged in the exe as well, not a separate file)

Additionally, I don't want the code to be easily extracted. This isn't a huge requirement, but I'd rather not have the source viewable in a hex editor.

I've got a few hits on Google, but if anyone has actually used one, your feedback would be invaluable.

edit

If I knew I was going to distribute this to the client when i started, I'd have used C#. But I didn't. Now they want to buy it. It needs to be DEAD SIMPLE. one executable containing the php interpreter and my script plus an entry point to start my script when the exe is run.

It would also be great if I didn't have to redistribute dll's either.

edit2

I am look for somthing along the lines of phc, or roadsend. phc doesn't support windows, and roadsend doesn't support php5 in windows.

A: 

Give them XAMMP.

mcandre
No. I don't want them to install this. I just want a native executable. One file, they double click it, it runs. KISS, ya know?
Byron Whitlock
It operates as a native executable which the user can double-click. Try it out for yourself.
mcandre
No it doesn't. I DON'T want them to install php on thier system. I want MY php script to be packaged as an executabl. The executable would contain the php interpreter and whatever it needs to run in ONE file.
Byron Whitlock
you could hand them a batch file that kicks it off.
geowa4
@Byron, phc exists for Unix. However, XAMPP seems to be the only option for Windows.
mcandre
XAMPP for simple command line application? You must be kidding!
el.pescado
+4  A: 

You want this: Bamcompile

http://www.bambalam.se/bamcompile/

You can use the WApache, too:

http://www.whenpenguinsattack.com/backup/?p=242

And, if none of these options satisfy you:

http://www.zzee.com/phpexe/

Paulocoghi
ZZEE PHPExe is exactly what I want. Too bad it costs $200. Thank you.
Byron Whitlock
if they want it, charge them the extra $200, and get a tool for free.
Zak
I have used Bamcompile extensively at a previous job, but I had to work my code around it's limitations. ZZEE sounds great, and I think $200 is quite fair for the tool which will enable secure distribution of your application... The cost of doing business, friend.
Fosco
+2  A: 

Okay I figured it out. there is a open source program called phc-win. It supports php 5.3.1, compiles scripts to byte code (obfuscation!) and is simple to use (It even has a gui).

It needs a php-embed.ini and whatever DLL's you use, but it just works.

Thanks for all the answers everyone!

phc-win 0.3.1 (c) 2009 Andrew Fitzgerald - [email protected] PHP Version: 5.3.1

  • To compile a single file:

    • Choose 'Compile single file' from the File menu.
    • Then select the file to compile.
  • To build an EXE containing all files in a directory and all sub directories:

    • Choose 'Compile directory' from the File menu.
    • Select the project folder.
    • Select the main program file.
    • phc-win will then recursively scan the specificed directory.
    • All files with 'php' anywhere in the extension will be compiled into .phb files.
    • These .phb files, along with all files in the directory tree will be added to the project EXE.

    • Once the EXE has been created, you will be asked about the EXE type:

      • CONSOLE (displays DOS box)
      • WINDOWS (no DOS box).
  • Place the EXE in the same directory with the required DLL file(s) and php-embed.ini file if needed.

Byron Whitlock