How do I convert a php web application into a desk

2019-06-24 05:55发布

问题:

We have a web-application developed in PHP. But most of clients don't have internet connection all the time. So, is there way to convert the app into a desktop application so that it works stand alone and it syncs to web application whenever there is an internet connection? Currently I am testing it locally via xampp and it works but I dont want to have to install xampp or wamp on a clients pc. I am an amateur at coding FYI. I would appreciate any precise answer with example.

回答1:

To avoid installing server on every client pc you can use Virtual Machine, so you would have same environment and just copy to every pc you need.

To keep the source code up to date (when connected) use GIT or other version control system (SVN may be easier to get into).



回答2:

A nice and simple way to do that without having to go through XAMPP or LAMP installation making it really simple to your users is to use PHP built-in server as of PHP 5.4.0.

$ cd ~/public_html
$ php -S localhost:8000

You can test this by adding an index.php in the public_html directory and then just run the command $ php -S localhost:8000 inside public_html. Open up your browser and type localhost:8000 so you can see your index.php file.

Another important thing is that your users must have Mysql installed (or whatever DBMS you are currently using).

Source PHP documentation



回答3:

You have to install mysql or whatever DBMS you are using at backend as well as install XAMPP or any other server to run PHP script. If you dont want to install full XAMPP you can use portable XAMPP which is just copy and paste. You can right a script which can keep checking after specific intervals, if internet is available then synch database with live server.