shasi kanth
shasi kanth

Reputation: 7094

Convert PHP-MySQL web application to desktop app (exe)

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.

Upvotes: 23

Views: 65380

Answers (11)

Emmanuel Mahuni
Emmanuel Mahuni

Reputation: 1944

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://github.com/cztomczak/phpdesktop

Upvotes: 1

Tarik Benali
Tarik Benali

Reputation: 57

Solution 1: There are several solutions to convert your web application into a desktop application, the one I prefer is the open source solution: PhpDesktop, but unfortunately it only supports SQLite.

Best Solution: To convert your PHP application with MySQL I know a paid solution that does this: 'ExeOutPut For Desktop', it is the best for this job

Upvotes: 1

Purefan
Purefan

Reputation: 1506

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 (https://github.com/facebook/hiphop-php/wiki/) 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#.

Upvotes: 2

Sarfraz
Sarfraz

Reputation: 382696

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
(source: winbinder.org)

Upvotes: 1

Ravinder Payal
Ravinder Payal

Reputation: 3031

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.

Upvotes: 1

JL Griffin
JL Griffin

Reputation: 423

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

Upvotes: 6

Richard Knop
Richard Knop

Reputation: 83697

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

Upvotes: 1

Yousf
Yousf

Reputation: 3997

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.

Upvotes: 13

Pekka
Pekka

Reputation: 449415

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.

Upvotes: 7

Artefacto
Artefacto

Reputation: 97815

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.

Upvotes: 3

user253984
user253984

Reputation:

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.

Upvotes: 5

Related Questions