Viewer for PHP

» UPDATE 06-Sep-2010: Uniform Server is now powering Viewer For PHP! Major Version 2.0 Released «

"The Uniform Server is a WAMP package that allows you to run a server on any MS Windows OS based computer. It is small and mobile to download or move around and can also be used or setup as a production/live server. Developers also use The Uniform Server to test their applications made with either PHP, MySQL, Perl, or the Apache HTTPd Server."
Download the latest Viewer for PHP.

» UPDATE 19-Mar-2010: The Mozilla Browser (Gecko using XULRunner) is Finally Embedded! Major Version 1.0 Released «

It took me a while but after months of searching I finally found code on how to embed the Gecko browser control. Funny enough this code is in C++ and I have no idea of how to program in C++, but after a litter tinkering I managed to compile a DLL of the current Viewer for PHP application and simply call the functions in the DLL from the C++ code to fire everything up.

Anyway, for those who don't care about the programming side of things here whats in the new release:

HELP WANTED: If someone is interested in making a better looking website for Viewer For PHP please let me know, also I want to create a gallery page where if you have created something useful and like to share with the public let me know. (sonusinghsonu AT gmail)

» UPDATE 20-Jan-2010: PHP and MySQL performance back to its best! «

After removing too many files from the PHP folder it slowed the performace right down. So now I have put back a lot of the files which has increased the size of the distribution by a few megabytes but at least now we a working product.

» UPDATE 19-Jan-2010: Title and size of main window customizable! «

A new file called display.ini has been included in the distribution that allows you to set the title and size of the main window. Gotta love BCX!
On the other hand MySQL performance seems to be a bit sluggish, possibly due to upgrading to PHP-5.2.12-Win32 or removal of extra files from PHP.

Still seeking a standalone embeddable broswer control (thats easy to work with!).

» UPDATE 18-Jan-2010: Viewer for PHP now works on Windows XP! Version 0.3 released. «

Thanks to Norbert Meier for pointing out the fault. Version 0.3 now works well on Windows XP. Please download and provide feedback.

Requests to make the title and size of the main window changeable have been made and I am currently working on it!

» UPDATE 6-Jan-2010: PHP_CGI fails to work on Windows XP (solution being worked on). «

» UPDATE 10-Nov-2009: Viewer for PHP now supports MySQL! «

There comes a time when we want to distribute our PHP files to the masses but in order to view the PHP pages you need to distribute:

I, myself, am one of those people. Searching the internet I only found packaged software, such as, WAMP, XAMPP, etc. I did find one software that allowed the user to just execute one single program and view the PHP files, but it is closed source and nonfree. So I decided to make something myself.

Viewer for PHP is what I have come up with, thanks to other opensource software. Using the mongoose webserver and just a few files from the PHP distribution, Viewer for PHP uses a web browser that is already installed on the system (eg IE) to display PHP files within itself without the need to launch the browser.

I am not a programmer by any means and if any "real" software developers want to develop this software further please do so.

Some of the features that I certainly like to see implemented are as follows:

  1. A complete (standalone) browser control contained within a single DLL file that can be used to embed the browser control into a calling application. E.g. Webkit.
  2. Perhaps trim down mongoose webserver to make it more efficient (and not display security warnings - on Windows Vista!)
  3. Develop an app to encode (.PHP) files so they can be protected from modification.
  4. Develop a PHP exention or module that will decode the (.PHP) file at execution time.
  5. (add your requirements to this wishlist)

Note to developers: Currently the project uses these development languages: BCX/BASIC (viewer.DLL), C (server.DLL) and wxWdigets/C++ (viewer.EXE)
It would be great if the whole project can be developed in pure C and compiled with a freely available C compiler.


Download the win32 binaries and source code from

Distributing your PHP Files

Download the win32 binaries and unzip.
Run the viewer.EXE file to test if it works on your system.
(if issued with a security warning on Windows Vista, select "Unblock")
If it all goes good you should see something similar to the above screenshot.

In order to distribute your PHP files to be used with Viewer for PHP simply put them in the php_files folder.
Name the main file index.php
Run viewer.EXE to test your files.

Current Development Tools

Currently I am using BCX to convert BASIC code to C and compile it with LCC-WIN32 C compiler. The mongoose webserver is compiled using MingW compiler. The viewer.EXE is developed using M$ VC++ 2008 Express Edition.

I am doing all this on a Windows Vista machine.


I am not really a programmer!

Viewer for PHP is just an app that starts up the webserver, mysql server and hosts a browser control (Gecko using XULRunner) inside it! Thanks to wxWebConnect (

* Compiling viewer.BAS							                                            *

I prefer to use BCX (Basic to C converter by Keving Diggins - viewer.BAS is converted by BCX into C code and compiled using the LCC-Win32 C compiler ( If you install BCX and LCC-Win32 simply run the build_viewer.BAT file and viola...

* Compiling mongoose.c 									    *

The code for server.DLL is in the mongoose.c and mongoose.h files (thanks to Sergey Lyubka & Gilbert Wellisch - I had to install MingW ( to compile the slightly modified version of mongoose.c into a DLL. If you install MingW and have set the correct path then simply run build_server.BAT and viola....
NOTE: You can build server.DLL using MS VC++ 2008 Express Edition, but I had some linker issues so I just used MingW.

* Compiling viewer.EXE									 								    *

viewer.EXE is created using MS VC++ 2008 Express Edition and you will need wxWidgets ( I simply downloaded wxWebConnect example code from and modified to use the viewer.DLL

Links to Resources

Need a Good Host?

If you are looking to host your PHP code online, take a look at this host. I use it myself and they offer value for money. Unlimited space, monthly transfers, hosted domains etc, etc. Have a look at their website before you signup (available in all countries):

For help and support please use the forum
Sukhpal Singh (sonusinghsonu AT gmail)
frontpage hit counter