create PHP desktop application

PHP

Hello everyone,

It is possible to develop a desktop application using PHP with the help of PHP Desktop. Then what is is PHP desktop ..?

PHP Desktop is an open source project founded by Czarek Tomczak in 2012 to provide a way for developing native desktop GUI applications using web technologies such as PHP, HTML5, JavaScript and SQLite. Think of it as Electron for PHP. It is a convenient tool for converting PHP web apps and PHP CLI tools to desktop applications with little effort. For more info visit https://github.com/cztomczak/phpdesktop.

All popular PHP frameworks are supported, see the PHP frameworks support wiki page for example configurations for,

  • CakePHP,
  • CodeIgniter,
  • Laravel
  • Symfony
  • Yii
  • Zend

Frameworks. Also visit the this link https://github.com/cztomczak/phpdesktop/wiki/PHP-frameworks-support

for PHP frameworks support.

 

Okey Friends lets go through the steps to create the desktop applicartion, please follow below steps,

Step 1 – Download phpdesktp

Please click here to download the phpdesktop. Visit the download section to download it. Unzip the file and rename the folder as myApp and move the folder where you want to place your desktop application.

 

Step 2- Create your own php page

Then open www folder of your myApp directory and remove all files and create a new file, name as index.php. write some php code here and save it.

For example your index.php is like

<html>
  <body>
      <h1>This is my First php desktop application</h1>
  </body>
</html>
Step3 – Run the application

 

click phpdesktop-chrome.exe in myApp directory. Which opens a new window, this is the desktop app that we created.

 

 

 

There also shows the console box.

To disable the console box, open settings.json file in your root directory, find debugging and change the value of show console to false (default its value is true). If you want to change your application name just rename title under main window also we can adjust window size etc. just go through with it.

Step 4 – Create the launcher or shortcut for our desktop application

Each time you need to open your application folder and click phpdesktop-chrome.exe to run the desktop application. To avoid this we need to create a launcher or shortcut for our application. Using Inno software we can create the launcher of our application. To install Inno software please click download button. Install inno.

 

Please read below section to create the launcher using inoo,

 

  1. click file->new
  2. open a new box and change application name,version ,then click next->
  3. next->
  4. here browse exe file(ie phpdesktop-chrome.exe) from you myApp and then click add folder button and browse myApp folder(select the folder of application to create the launcher), then click next->
  5. next->
  6. next->
  7. select the language, click next->
  8. browse the path where you want to create the launcher or shortcut, then click finish.
  9. Compile the new script.
  10. Check the path, that you browse to create the launcher.
  11. Double click the shortcut and you can see that your desktop application works fine.

I hope its works fine.  If you have any doubt, please comment on comment section.

Thanks for reading this article…..

Leave a Reply

Your email address will not be published. Required fields are marked *