tags:

views:

132

answers:

7

Hi all, i have developed a php-mysql web application, which is a school based project. My client wants the this application to be converted into a .exe file such that it can be installed on his desktop and use it.

How can the php website can be converted to a .exe file and can it be run without the need of a database/server software ?

Please advice.

+1  A: 

No. You have at least to remove the dependency on MySQL (and use e.g. sqlite instead).

Then, you would either have to:

  • Convert the webpages to windows dialogs. This would completely change your application (e.g. what would originally be http "form submissions" would be someting completely different). At this point, it'd much easier to write a .NET application
  • Bundle a web server (e.g. Apache) with PHP installed.
Artefacto
A: 

Not sure that's gonna be possible but have a look at:

WinBinder

WinBinder is a new open source extension for PHP, the script programming language. It allows PHP programmers to easily build native Windows applications.

alt text

Sarfraz
If i understand the question correctly it's not what he asked for (as that would be a full rewrite of the application).
dbemerlin
@dbemerlin: Yes, conversion seems to be not possible unless someone comes up with a real solution, I have just posted the other steps he might want to take.
Sarfraz
Complete re-write is not an easy option! Even if he decide, dealing with PHP's echo is much different than GUI manipulation. Anyway WinBinder is nice concept.
Yousf
@Yousf: Agreed and as I said, if there is a solution to convert existing web application into desktop application, it will be the way to go.
Sarfraz
+6  A: 

Short answer: Not possible.

Long answer: It depends.

You could install a web- and database server on his machine (or create an installer that does it) and run the application locally on his machine.

or

You keep the application on a server and just provide a launcher that opens his browser and points it to the URL of the application.

As Artefacto mentioned, it might be a good idea to switch to SQLite instead of MySQL but depending on how your application is written it might require a lot of code and SQL Query changes.

dbemerlin
+3  A: 

NuSphere's PhpDock claims to do this: It serves as a deployment helper and comes with a bundled web server. However, I don't know about the database part, and it's not free.

PhpDock enables you to deploy any PHP web application as a Stand Alone Windows Desktop application w/o any changes in the code.

I don't know that particular product, but I have been using their IDE for years and am quite happy.

Pekka
+2  A: 

The convenient solution is not to convert the website to .exe. I think it will be better if you have portable server/php/mysql and make the website work from a usb or CD with autorun.

Yousf
A: 

Just create a simple program in C or C++ that will just add icon in Start menu, desktop and Quickstart. If your client clicks the icon it will open the default OS browser and point it to URI of your application online.

That might fool your client :)

Or maybe it will be enough for him (he might be asking you to convert it to exe because he can't remember URI or something - ask him what is the reason).

Richard Knop
Hi, thanks for all your replies. Here the sole purpose of converting the php app into a stand alone app is to sell the product to the clients as a software. So once they pay the amount, they will be handled the .exe file on a CD, which they can use to run the application. Also the software must allow one time installation on a system, so that the same CD is not reused again in the same system (like the genuine OS installation). Coming to the point, SQLite can be used as the database for this instead of mysql. I can rewrite the application, not a problem. Iam also considering the GTK option.
dskanth
but I dont know how to develop using it. No proper documentation is available. By the way, i came across this software that converts a php app into a .exe file. It is not free though: http://www.byterun.com/website-compiler.php
dskanth
Hi, i have across this product, that claims to convert the php app into a standalone app. http://www.roadsend.com
dskanth
+1  A: 

Another try would be to turn your php project into PHP-GTK (http://gtk.php.net/). Yet another one is to give HPHP a try (http://wiki.github.com/facebook/hiphop-php/) and try to turn the generated C code into something like a .DLL in .NET and use it for the logic while coding the UI in say, C#.

Purefan