You are on page 1of 4

Bambalam PHP EXE Compiler/Embedder 1.21 Created by Anders Hammar (c) 2006 Bambalam - www.bambalam.

se/bamcompile bug reports / feedback email: Usage: bamcompile [-options] infile.php [outfile.exe] bamcompile [-options] project_directory mainfile.php [outfile.exe] bamcompile projectfile.bcp Options: -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 Revision history: 1.21 2006-08-28: Fixed an issue with apps using extensions crashing if php4ts.dl l was in the system path 1.2 2006-08-24: Added an extension loader - extension dll's can now be embedded Added a project file feature Added support for exe icons UPX is now embedded, it's no longer needed in the system path Upgraded to PHP 4.4.4 Fixed some compatibility issues when running on a system with P HP installed lots of minor bugfixes 1.1 2006-06-09: Added the php_sockets extension to the static build + minor bugfixes - What is it? Bambalam PHP EXE Compiler/Embedder is a free command line tool to convert PHP applications to standalone .exe applications. The exe files produced are totally standalone, no need for php dlls etc. The php code is encoded using the Turck MMCache Encode library ( so it's a perfect solution if you want to distribute your application while protecting you r source code. The converter is also suitable for producing .exe files for windowe d PHP applications (created using for example the WinBinder library, www.winbinder .com). It's NOT really a compiler in the sense that it doesn't produce native machine c ode from PHP sources, but it works! - How does it work? The converter embeds encoded PHP source files as resources in a generic statical ly compiled PHP launcher executable. It also has an option to compress the final ex e using the UPX executable compressor ( Simple console appli

2. php libraries (or extensions) now can be embedded as needed. as long as you include stuff using relative paths. the converter uses a PHP runtime based on PHP 4. But once you have compiled your exe.What PHP version is supported? Currently.What about PHP 5 support? I haven't got around to it..exe) and if the files aren't found there it looks for it in the embedded filelist.What about accessing the embedded files from php? You can access the embedded files just as you're used to.4 . You still have to have access to the php extension dll files when embeddi ng of course. . that's the only file you have to distribute! . But I haven't done any decent tests on it. Or. .4 works in most cas alot smaller standalone exe files than PHP 5 would d (well. but o wait for it. and the PHP 4 runtimes produces o. the converter is able to embed a whole project directory. es.cations end up with an executable at a size of 500-600kb. they are shipped together with the PHP distribution.Does "compiled" PHP applications run faster? Theoritically it should.So the INCLUDE statement works just as it should? Yes. I think) should contribute t o faster applications. you can create a bamcompile project file (. .What libraries / extensions are included? As of version 1. for example. So. Having libraries linked statically and by encoding file s (Turck MMCache encodes PHP sources as PHP bytecode. if you're making an application that uses the gd extension. if you want. You can also use the EXTENSION command when working with bamcomp ile project files.What about PHP applications with more than one source file? No problem. just but I probably will! But PHP 4. . .) But as I said. PHP 5 is a bitch to build on windows ther than that.4. The PHP runtime used h as been modified so that when you're accessing a file it first tries to access it the us ual way (by looking in the path outside the . it's easy to build the standard builds.4. .bcp) and embed files from all over th e place.d ll option and you'll be fine. use the -e:php_gd2.

.dll needs isqlt09a.dll needs fribidi. just include the php.Note however that some extensions use other system dlls which needs to be shippe d together with your compiled exe to make it work. Some examples: php_curl. Optional.dll needs libeay32. use the internal extension loader instead.dll php_ifx.What about PHP.dll php_mssql.ini to set ini specific settings.ini to load extensions but it was messy and honestly didn't work that well.dll php_msql. . if you want to use extensions.php Sets the mainfile to whatever mainfile you want to use.ico command line option or the ICON project file command.exe Sets the output file exe name.dll needs ntwdblib.What is the format of Bamcompile Project files? A project file has the extension .dll and ssleay32.dll needs FDFTK.dll php_fribidi.dll php_mhash. such as GD. one on each line: MAINFILE mainfile.dll needs mSQL. Older versions of Bamcompile used the embedded php.INI? Can I embed that as well? Yes. The following libraries are included statically: Turck MMCache bcmath calendar com ctype ftp mysql odbc pcre win32std xml zlib . COMPRESS Compresses final exe file with UPX . use the -i:icon. Sockets. Winbinder and Sqlite don't need any syste m dlls and they embed just fine.ini in the root of your project. You can still embed php. However.Can I add a custom Icon to my exe? Yes.ico Sets an icon for the output exe file.dll php_fdf.dll But most of them. Optional.dll needs libmhash. ICON icon. OUTFILE outfile.bcp and is built up using simple commands.

png Used to embed files. Directories are embedded recursivly DESTINATION destination_path/ Sets the destination path in the embedded filesystem. Use the destination comman d before an embed command to change where the embedded files end up. Ok? . directories or files using a fi lters.php EMBED whole_directory EMBED directory/*. let's jus t say that it's free. I don't really know much about licensing :). removes the "dos box" otherwise shown EMBED directory/file.What about license? Just how free is this utility? Well. of course. the root /. So urces are available on the website. EXTENSION path_to/extension. You can embed single files. .DONTENCODE Do not encode php files WINDOWED Windowed application.dll Adds a PHP extension to the internal extension loader. I guess that the tool is released as open source under the PHP License. The extension will be emb edded and loaded from memory. The default d estination path is. and I don't want to get sued.