Desktop applications with PHPRunner

PHPRunner 9 adds an option to build and package desktop applications as well as web applications. In this article we'll try to answer most common questions and explain what PHPRunner desktop applications can and can not do.

How it works

First of all, Desktop apps functionality is built on the top of wonderful open source PHP Desktop project. PHP Desktop packages together the following software components:

  • web server (Mongoose)
  • PHP
  • Chrome browser


When you start PHP Desktop application it start the web server first specifying 'www' directory as website root folder. Then it starts Chrome browser pointing to web server's home page. Browser application is modified to hide all menus, navigation buttons and address bar. You just see the application itself. This is pretty much it. You can download PHP Desktop and play with it on its own putting any PHP code to 'www' folder and starting phpdesktop-chrome.exe file.

PHPRunner takes one extra step packaging the whole application into a single installable EXE file. We use Inno Setup for this purpose. The whole packaging process is described with great details in excellent Create Your First Desktop Application With PHP And PHP Desktop tutorial.

Limitations

  • Windows only

    PHP Desktop runs on Windows only.

  • PHP only

    PHP Desktop, apparently, is for PHP only. However, since a standalone IIS Express browser exists we can expect at some point that

  • Installer is not signed

    This is not a big deal when you only distribute your application among your company users. If you want to make desktop version of your app available worldwide you definitely need to sign the installer. Check this post for more info. Probably at some point we'll add signing support to PHPRunner. You will still need to obtain your own

  • Not an offline version

    For some reason people confuse 'desktop' with 'offline version of online application'. Desktop application is no different from the web application except it sits on your desktop. If your application uses a remote database you do need Internet connection to connect to that database.

Some typical use cases of desktop version

  • You need to create a desktop application. You are a PHP developer who needs to create a desktop application. PHPRunner can help you with this. The natural choice is to use SQLite or MS Access database in this case.
  • You need to create an application that doesn't use database at all. An example - Euro 2016 desktop application. It connects to football-data.org API, retrieves data and displays it. You don't need a website or a database in this scenario.
  • When you need an access to hardware or to file system. Using a desktop app you can access devices connected to end user machine, work with file system, use COM objects etc. You can do pretty much everything the typical desktop application can.
  • You can use your desktop application to connect to remote database. This is the less typical scenario but still plausible. Probably you do not have a website or do not want to maintain a website, take case of security etc. All you have is a database like MySQL or Amazon RDS with remote access. In this case desktop application can be useful as well.

2 comments to Desktop applications with PHPRunner

  • Beta Tester

    This is definitely a good and welcome addition to PHPR.
    You can add one or two more function in it and it will become perfect.

    Synchronization:
    In some cases, when there is problem with internet, we use offline version of database in order to print out some quotations, invoices etc, and after getting online, we have to re enter it online.
    If you can add synchronization capabilities between online and offline version, that would be so awesome.
    It will help to those users too, who have slow internet and have work load, they can work in desktop environment offline, then can synchronize in the eevening.

    Backups:
    It will be a great feature, if you add database backup and restore feature, in generated application web and desktop version.
    ie add a main menu button in admi area for maintenance or you can change name, under it have backup and restore buttons.
    Thanks in advance in both cases, whether you plan it in future or implement in PHPR 9.

  • I’m going to try out this feature soon. I do have one question:

    I would be using the desktop app to connect to an oracle database. Is there a way to configure the desktop app to NOT need the oracle client to be installed first on the client machine? (I guess its not a big deal if I need to install the oracle client first but I don’t know if it is possible to tweak something with the PHP, etc. so the php can connect directly without the oracle client).

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>