How to turn a php script to an exe..for free
There are a few commercial products out there that allow you to turn your php scripts into an executable. While most of them work well, I have found a way to do it for free, using an open source application. This application is called Wapache (based on the apache web server) and it is open source (distributed under the Apache License 2.0).
WApache doesn’t convert your script directly into an executable, it runs on the combination of a windows app (which uses an embedded IE control) and a stripped down version of apache.
Features
- No Internet Explorer menu, tool bar, or address bar.
- Precise control over placement of windows
- Three types of windows: basic, tool windows, and dialog boxes (modal and modeless)
- Fully customizable drop-down and context menu
- System Tray integration
- Asynchronous data handling
- Works with standard Apache modules like mod_php and mod_perl
screenshot

(this is a screenshot of wapache running phpmyadmin)
How to turn your php script into an executable
1) copy all of your scripts/files into the htdocs directory (make sure that the main file is called index.php)
2) launch bin/wapache.exe
3) you will now see your php script in the application that is running
There is also many options that allow you to configure the app in many different ways. This can be found on line 100 of conf/default.wcf (documentation for this config file can be found here):
HorizontalAlign Center
VerticalAlign Middle
Height 60%
Width 60%
3DBorder Off
IconPath "../icons/lightbulb.ico"
</StandardWindow>
This could be used for a demo/trial of a web application. A windows installer could also be used (NSIS works well and is free) to create a fully installable, desktop application.
Since this only relies on the apache web server, it’s also possible to use this with any type of supported scripts.
Download
The latest version of Wapache can be found here
3 comments
[...] a new post to his blog today Justin points out a tool you can use – WApache – to turn your PHP script into a [...]
Interesting post.
Could I create, with this, a .exe that runs wordpress, or oscommerce?
Let me know.
@andre,
yes, you could. But, it would only be running locally on your own machine.
Leave a Comment