Tutorial :Convert php site to .exe desktop app



Question:

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

How 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.


Solution:1

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.


Solution:2

I was also looking for a similar solution and found https://code.google.com/p/phpdesktop/

Hope this helps.


Solution:3

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.


Solution:4

try using a site-specific browser. it will make a desktop app that is basically a portal running to your webapp. try this one:

https://mozillalabs.com/prism/

It allows alot of advanced features like system tray icons and such. I have used it many times!

Hope this helps, JL


Solution:5

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.


Solution:6

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.


Solution:7

Php desktop is the way to go, it's actually very simple to modify to the version of PHP you want to use and is open source too https://code.google.com/p/phpdesktop/


Solution:8

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#.


Solution:9

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 http://winbinder.org/pic/fe_big.png


Solution:10

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).


Solution:11

You can use xampp open-source project to pack your PHP site into an executable file.

Use the following steps:- 1. Download Xampp source code.

  1. Add your PHP file inside htdocs directory(Ref:- https://sourceforge.net/p/xampp/code/HEAD/tree/win32/xampp/htdocs/).

  2. Now compile the XAMPP source code and distribute it.

  3. For DATABASE creation and initial data loading in the database, you can code your site in such way that if database is not created, it redirects the page to install.php which do the database creation and data loading task using sql file provided(you need to add SQL file containing database structure and required data).

Don't forget to delete the SQL file post installation of database.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »