Wednesday 5 July 2017

Make Professional Desktop Application With PHP And PHP Desktop


I understand such people. Creating a desktop application with PHP is not a lame thing, but desktop applications themselves are becoming so. Time has changed and these habits are dying, but still they are use cases again where one can require a desktop application, and I confirm you can go ahead with PHP desktop if your need is not that huge.
So, I have decided to write a second tutorial on the subject. In the previous part I focused mainly on how to use PHP Desktop for the first time and run a little php code with it. I also gave you a sample application which I did not explain how exactly I did it. That tutorial was more about how to compile you application with Inno Setup too.
enter image description here
In here I will go deeper because many problems were faced in the previous part such as:
  • Error while opening the settings file, Application will terminate immediately
  • Database connections
  • Error 500: Internal Server Error Cannot spawn CGI process [C:Program Fileshpm pp/index.php]: No such device or address"
  • PHP desktop has stopped working
  • Changing the application Icon
  • Using MySQL instead of SQLite
  • How to protect the source code
  • Synchronizing the desktop application with an online version of the application
  • There is no disk in the drive. Please insert a disk into drive DeviceHarddisk1DR1.
  • Error while opening the settings file, Application will terminate immediately
  • The Program can't start because libcef.dll is missing from your computer. Try Reinstalling the program to fix this problem
  • Getting the application path right
  • Making your port static
  • Synchronizing the desktop application with an online version of the application
  • There is no disk in the drive. Please insert a disk into drive DeviceHarddisk1DR1.
  • Error while opening the settings file, Application will terminate immediately
  • Minimize to the tray
  • Access Application through LAN
  • etc
Many people found solutions to some of these problems and many did not border to read the comments feed to find out what was said and therefore re-posted same questions. I would like to call your attention to that fact right now. We're many and everyone has a different configuration on his/her PC, always pay attention to that. Most problems people faced are due to their computers' settings.
For instance, people asked many times how to do the database connection while I did answer this question in the answer #100. But, such situations made me realize that some of us do not have a considerable level in PHP and some other stuff when it comes to windows. To illustrate that let's consider this error:
cause libcef.dll is missing from your computer. Try Reinstalling the program to fix this problem.
Anyone who is really used to Windows OS should understand that the libcef.dll is missing in the software he/her is trying to run therefore you need to get the .dll in or you download a new copy of the software. Mostly missing DLL problem occur when your OS is not fully updated.
NOTE: I also want you to keep in mind that I did not create PHP Desktop, therefore phpocean.com is not the first reference for that software. The official group talking of PHP Desktop is at http://groupe.google.com/phpdesktop, and at the same time many of those problems you are facing have certainly been solved over there. Do take some time to visit it and search before asking your question, or if you did not understand the solution share with us here. We might help and it will help us reduce duplicate posts.
Some other people had issues installing PHP frameworks like Laravel, CakePHP, Symfony, etc. Know that it's possible to install them on php desktop. Here is the page that shows all the framework PHP desktop supports and how to do that.
Some other deployment issue many faced is the right to write in the windows Program files and Program file(x86) folder. Indeed it's an issue that has been addressed here.
In this second part of the tutorial, I will walk you through how to create a simple hospital Patients Management Applicationcompile it, and install it. During that, I will take the chance to try to solve/answer some of the problems you encountered during the first part.
In order to keep the work clean, I will be cutting this tutorial into little parts. In the upcoming part, we will focus on how to develop our application and how we can possibly secure our source code. During this phase, you will also learn how to use PDO and SQLite. In order to keep the code clean and universally accessible, I will be using Slim Framework for that.
In the third part, we will be learning how to configure PHP Desktop in order to make it easily installable on windows. Here we will be solving most of the installation problems. We will also go through how to read/write to windows registry.
In the fourth and last part, we will tackle the compilation and installation issue. We will see how to change our application name, icon, details, and so on.
There is a lot we can do with PHP Desktop. I will do my best to keep the articles as simple as possible. Stay tuned for the next part. You will be receiving my newsletters every time I publish. If you are not yet subscribed, please try doing it now so that you don't miss out. See you for now.

1 comment:

  1. how to solve this error "Error while opening the settings file, Application will terminate immediately"

    ReplyDelete