torayeff
torayeff

Reputation: 9702

standalone web application

Is there way to run web application as standalone desktop application? Could be web application written using PHP, MySQL and Apache converted to standalone application which meets following requirements:

1. Application should be called as http://myapp.localhost.
2. Application should have desktop icon which directly opens browser with application's URL.
3. Source code of web application should be hidden from users.
4. Installation for end user must be as easy as possible.

Now I do steps 1-2 using xampp and manually creating shortcut. I was interested in some wrapper, installer which do above steps automatically. But I have no idea about 3rd step.

Upvotes: 5

Views: 7661

Answers (4)

Michiel De Mey
Michiel De Mey

Reputation: 198

I'm afraid it's not that simple.

  1. If you want to use this approach (and I highly discourage it), you will have to deploy a webserver of some sorts on the client. You should be able to run the Apache/IIS Express and MySQL/SQLite executable and start a simple webserver and database.

  2. If you'd also like a icon, you can create an installer that creates this icon and points to the URL you wish.

  3. I'm afraid that's not possible. PHP is and always will be a scripting language. You might be able to obfuscate it somehow, but anyone who can download your application will be able to de-obfuscate it.

  4. Again, you can create an installer. Inno Setup is pretty good from what I've heard.

Upvotes: 0

Tengiz
Tengiz

Reputation: 8419

PHP and MySQL require to have a web server running. That means you will need to copy the code over to the client's machine and then run the web server locally still on the client's machine.

If that's what you want, look into the Microsoft IIS Express (here).

In short, IIS is a web server that can host and run a server side web application, written in ASP.NET or PHP.

Here are the steps you need to take:

  1. Install IIS express on the client's machine (one-time process, and I think quite acceptable - treat this as a runtime installation).
  2. Create a designated (hidden) folder for the source files of the web application that you want to deploy (one-time process).
  3. Create a windows batch file (bat or cmd) that starts the IIS (as described here) and then opens the website's URL so that the default browser starts. This file will serve as a shortcut, so you can place it on the desktop or wherever appropriate (one-time process).
  4. Deploy your web application to the hidden folder from step 2 above (repetitive process - deploy to the same folder when you want to upgrade the clients to a new version).

Please have in mind that I am basing my suggestion on your requirement to host and run the application locally (on localhost).

However, if there's an option to run the application on a separate machine (not a localhost), then you could simply place a desktop shortcut to the network or internet address URL that would open the default browser without problems.

Upvotes: 1

tshenolo
tshenolo

Reputation: 463

i would suggest Pouchdb http://pouchdb.com/api.html and Adobe Air http://www.adobe.com/devnet/air/air-sdk-download.edu.html. This way you can code with html and javascript and package it with Adobe Air.

Upvotes: 0

klugerama
klugerama

Reputation: 3352

Regarding item 3, see Can you "compile" PHP code?. This would allow you to develop in PHP and deploy the application via an installer.

There are several installer packages which would allow you to automate these steps, depending on your development environment.

Upvotes: 1

Related Questions