3

I have to develop a real estate marketing CRM software for my client - where the application is installed on desktop but can also be accessed from web.

2 reasons why they want the application to run from desktop :

  1. So that it can work with/without internet connection
  2. They don't want their complete data to be online

They want to access few of the data like property listing & inquiries (managed from desktop application) from their website through secure login & password.

The data that is entered in desktop application should be automatically synchronized with the website application. I was wondering if there is a way to develop this kind of software using PHP & MySQL. If yes, it will be great if anyone can provide me the referral link.Else please suggest, which language should I use.

4
  • 8
    The data that is entered in desktop application should be automatically synchronized with the website application. If it's offline then the "automatic synchronization" needs to have some window or times that it can occur, also if it's a 100% offline desktop application, how do you plan to handle the scenario where someone has no internet access ever? Also how do you plan to deal with the merging of changes from web and desktop which conflict during that synchronization? This is a complex problem and it sounds like you need to do a lot more study. Also there's no clear question here. Commented Nov 23, 2012 at 21:22
  • Have a look at PHP Desktop that embeds php web-server and IE engine turning php scripts into native application. Commented Jan 13, 2013 at 4:13
  • @JimmyHoffa if someone has no internet access ever they are effectively not using the same program as everyone else.
    – Brad
    Commented Apr 30, 2013 at 20:28
  • 1
    TideSDK would be good option. They provide better support. Commented Jun 11, 2013 at 11:24

9 Answers 9

20

There is a way, yes, using a binding to a GUI library like PHP/Gtk. But I don't advise that.

Instead, use a language like C#, VB.Net, Delphi, Lazarus, or Python to create the desktop app. Their support for desktop applications is much more mature. The results will be far better, and you'll have fewer headaches from the experience. Don't try to force the square PHP peg into the round desktop hole.

If what you are really asking is if you can create desktop software with web technologies, then yes that is possible. Look at tools such as nwjs (was node-webkit), with which you can create desktop apps using HTML & JavaScript. In such an application, no webserver would be required - though it can certainly talk to a web server on which a PHP app was running if needed.

2
  • is PHP/GTK even still maintained / binary distributed? Also there is PHP/QT, but AFAIR it's quite unstable.
    – ZJR
    Commented Nov 24, 2012 at 2:40
  • It was nice you put the link of nwjs as you mention it
    – Ahmad
    Commented Jun 4, 2015 at 5:42
12

A possibility could be to develop the application as a web application and run your web server on your desktop. In this way you do not need a different technology.

EDIT: there exist portable web server solutions (for example, http://www.server2go-web.de/ or http://portableapps.com/apps/development/xampp), which make this approach work much more smooth.

2
  • This was my first thought, also. Commented Nov 23, 2012 at 22:46
  • Security issues in this setup will have to be considered, though probably this is an intranet and a limited scope application, so I bless the attempt, just take care. If targeting windows you may have also give a look to this obscure MS technology: .hta
    – ZJR
    Commented Nov 24, 2012 at 1:47
8

It's possible, but it's rarely done. PHP was designed as a language for generating HTML and its functions aren't helpful in desktop applications.

Things will be easier if you learn another language.

PHP-GTK, PHP-QT, and PHP-Wx exist but don't have any significant community. Trying to make a deployable app will be difficult.

5

PHP-GTK is an extension for the PHP programming language that implements language bindings for GTK+. It provides an object-oriented interface to GTK+ classes and functions and greatly simplifies writing client-side cross-platform GUI applications.

http://gtk.php.net/about.php

GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off tools to complete application suites.

http://www.gtk.org/

4
  • 1
    That link is often referred to, but has anyone heard of one app made with php-gtk? Just one? Even a bad one? I mean even their own list of application (gtk.php.net/apps) is totally and utterly empty. I don't mean to say php-gtk is a stalled, or unuseful project (never used it). But I'd wager it doesn't have very good support, and not much community help.
    – Xananax
    Commented Jun 20, 2011 at 17:23
  • I think using something such as air or appcelerator titanium fits the bill better (although I haven't tried it yet either).
    – Xananax
    Commented Jun 20, 2011 at 17:24
  • 1
    -1 PHP GTK was dead, long before you answered the question. @Xananax Titanium is a good alternative, but it's still not there yet.
    – yannis
    Commented Dec 29, 2011 at 13:07
  • Yup, I have tried it since then, but there are a lot of bugs and missing docs (no bashing of titanium intended, the eclipse-based IDE is very cool, but it still needs a lot). Air is proprietary and dev is hard under linux. I am exploring the possibility of building my own wrapper around webkit through QT.
    – Xananax
    Commented Dec 29, 2011 at 14:11
5

When all you have is a hammer...

In theory, yes. In practice I wouldn't.

There is a PHP-GTK extension that allows you to build GUI applications on top of PHP (though I've never used it).

However, PHP is not intended for building GUI apps and its architecture isn't conducive to such projects. PHP is built to handle short-lived request/response application models and that's what it does best.

You should pick tools appropriate to the job you're doing rather than trying to force a given tool you're familiar with into a role it's not made for. The result will never be anywhere near optimal if you do.

There are plenty of other languages that provide the functionality you need to build a CRM application, java, C#, C++ and a whole slew of other tools. They're also better suited to building GUI applications than PHP is. I'd seriously consider looking at one of those instead.

2

Here are two possible approaches I would take:

  1. You could try Appcelerator Titanium for Desktop development with PHP.

  2. Alternatively, you could install a local web server, develop the application logic, create a web-service and develop the view logic in something like Java to interface with the web-service.

If you take the second approach, I'd recommend you to use REST as the type of web-service.

0

Yes its possible php gtk project is no longer active, with the power of php 5.4 there is a better platform called wxphp something based on popular wxWidget, give a try I think you'll not disappointed

Here's why:

  • Its build over most popular wxWidget
  • Compatible with Windows, Mac, Linux/Ubuntu GUI platforms
  • wxWidget Always use native GUI
  • wxWidget still under active development

For more about wxWidget visit here wxWidget

0
0

Nightrain - PHP Desktop Packager might be what you are looking for. Nightrain does not include MySQL but you can install it on the user's computer or you can just update your application to use SQLite Database. For your these particular requirements switching to SQLite database might be better.

Here's what you have to do:

  1. Download Nightrain from: http://www.nightrain.naetech.com/
  2. Copy your application to the /www folder
  3. Run the nightrain executable to launch your application, test it out or do whatever adjustments you have to
0

Sounds kind of crude, but just export your data as a Spreadsheet. And let them play with the spreadsheet on their desktops. You could go mad and have the web server upload a modified spreadsheet and apply any updates to the central DB.

Obviously this is very error prone and clunky, BUT, so is any other offline replication solution. At least the users will be aware of the obvious problems. Any other solution will have the same underlying problems but a slicker interface will give a false sense of security.

Not the answer you're looking for? Browse other questions tagged or ask your own question.