How To: PHP Script To Windows EXE File Generation

By Angsuman Chakraborty, Gaea News Network
Saturday, March 22, 2008

<b>PHP</b>PHP files are scripts which are interpreted by php interpreter (php.exe in windows). Converting them to exe files makes it easy to distribute PHP applications to Windows users. Unfortunately Zend, the PHP company, doesn’t provide a way to convert PHP scripts to Windows executables. Today I am going to show you a simple way to convert your PHP scripts to regular Windows executable files (.exe). Not only that you can also convert an entire directory of PHP scripts and assign one of the files as the main file to execute first. Additionally the source files are encoded which not only improves the performance but also protects your source code. You can also set the icon for the file which is useful when you are distributing your PHP application as a stand-alone executable.

Bambalam - <b>PHP</b> to EXE ConverterBambalam PHP EXE Compiler / Embedder is a free command line tool to convert PHP applications to standalone Windows .exe applications. The exe files produced are totally standalone with no need for php dlls etc. The php code is encoded using the Turck MMCache Encode library. It’s a perfect solution if you want to distribute your application to Windows users while protecting your source code at the same time. The converter is also suitable for producing .exe files for windowed PHP applications (created using, for example, the WinBinder library). It’s also good for making stand-alone PHP Socket servers/clients (using the php_sockets.dll extension).

It’s NOT really a compiler in the sense that it doesn’t produce native machine code from PHP sources, but it works! Currently, the converter uses a PHP runtime based on PHP 4.4.4.

The tool is free and open source.

bamcompile [-options] infile.php [outfile.exe]
bamcompile [-options] project_directory mainfile.php [outfile.exe]
bamcompile projectfile.bcp

-w Hide console window for windowed applications
-c Compress output exe (using UPX)
-d Do not encode PHP files
-e:extension.dll Embed and use PHP extension
-i:icon.ico Add icon to exe

You can download it here.

March 14, 2010: 4:04 pm

does not work. I wrote my own forums and this DID NOT convert it to work. Too bad. i would love to get all the scripts I wrote to work but this is a major bust.

May 5, 2009: 9:11 am

I have done a project in PHP. Now i need to know how to use php to exe conveto
r(such as bamblam)

May 5, 2009: 9:10 am

I have done a project in PHP. Now i need to know how to use php to exe converter(such as bamblam)

March 10, 2009: 2:41 pm

how to make browser disablde pop menu, read only, can’not copy, can’t save as, and how to execute exe file with php ? please help me

February 14, 2009: 10:18 am

anybody can help me, i dont know how to use this bambalam..i did click just like praveen said



January 27, 2009: 7:17 am


i downloaded bambalam software and it has given .exe file also when i run the .exe file it is not showing anything does any changes has to made before running bambalam and how to connect with mysql is it any settings to connect mysql.

please anybody help me.

thanx in advance.

April 12, 2008: 8:30 am

Hello, how can I use PHP server to creat a web page please? Steps and requirements. Thanks

March 24, 2008: 5:11 pm

thankss you.. soo much.

will not be displayed