Hello,

I am thinking about making one small project with PHP, javascript, becasue I don't have experience in other languages too much. It would be something like addition to a windows program which uses postgre sql database. I see that I can make one feature from that database. For me it would be ok, since I am programer, not a huge problem to instal php server on my computer. But for non PHP programmers I want to make it as easy to install as posible - like usual windows progams - next next next and thats it.

What would be the easiest way? Also it would be good when user wants to run the the program - the php serwer would start, but when he closes the program, php server would shut down.

BTW each user is already having postgre databse on their computer, because that windows program uses it from localhost. Thtas how I got the idea, since I see those database tables myself and can make selects.

Member Avatar for LastMitch

@SPeed_FANat1c

Is it posible to make some installer program PHP

I'm not getting what you are saying. You want to make/create a php install exe file?

Yeah, installer I want. So it would install php server on users computer and my php project as well. And throw the link to index file to the desktop. So user can open it in the browser and use it.

But to avoid complicated install procedure.

Another option is I am thinking to make simple web service with connects to database and can return json strings of data results.
THen use javascript to read from that web service. And form on the html page for the user.

WIth something like c# maybe. I don't have exp at C# but did quick google search and it says its easy to make web service.

Sounds like OP is trying to make a PHP desktop app.

You may want to read up on this to make sure it's how you want to follow through, as the general consensus seems to be that there are far better options:
http://stackoverflow.com/questions/40870/why-dont-people-use-php-for-desktop-applications

Further, you can't natively use JS for apps (except maybe in newer versions of Windows 8). You'll need to use some other method to implement it, like Adobe AIR or app.js... http://stackoverflow.com/questions/109399/can-you-do-desktop-development-using-javascript

Member Avatar for LastMitch

@SPeed_FANat1c

WIth something like c# maybe. I don't have exp at C# but did quick google search and it says its easy to make web service.

I be honest with you. I rarely see anyone used exe file to extract php files.

I mean the closest things that you can do that is using a .bat file to run the php files on the computer.

May I ask why you want to do something like this?

@EvolutionFallen interesting liks. Still not sure what way woud be quickest, easiest.

May I ask why you want to do something like this?

Because I don't have experience with other languages like C# or something. But I want to make desktop app which acceses local database :) I just cannot find another way to access local database.

My app stil could be on the web if there is a web sercive in users computer reading sqls from his database. My javascript could read that web service on local computer.

Why not create a setup that installs WAMP or XAMPP, as well as all scripts.

If you create a Win8 store app, then you can stick to HTML/Js and even have SQLite at your disposal. Plenty of tutorials for these apps available.

Why not create a setup that installs WAMP or XAMPP, as well as all scripts.

yeah, might be an option. but never have created windows installers, not sure if without experience is this easy or not, but if they are made well, then I assume it should be easy.
Not sure about php configuration. Should work usually as default, but might be problems as always.

Member Avatar for diafol

php doesn't usually scale well to desktop apps due to the fact that you have to install php, mysql et al. However, php-gtk could be of some help here, but the installation and documentation are a headache. If an user already has an *AMP installed, I don't think you'd want an installation routine to create a new copy. Have you looked at Java?

I don't want documentation where I will have headache :)

I have xmap installed. But I have configured for my computer - different project folder.

Could make another xamp with php files in it and compress it. So the user would need to decompress.

No, did not look at java. I was writing small programs with it at uni, but have forgot much, because it was few years ago already.

check out wapache, a sourceforge project, I think it will be your perfect solution, I have built some desktop apps with it, using sqlite database. It's as easy as making a website.

commented: nice link - new on me :) +14

will have to take a look at wapache, if it supports postgre sql. If it doesn't then I cannot use it.

tried wapache demo, and actyally I liked it :) runs with no huge lags, at least with those simple windows with no javascript probably.

For example starting wamp or xamp server takes much longer, but here it started like instanly. So this is good.

Only thing - why it is based on internet explorer :D would be much better if it was on chromium engine. But ok :)

tried wapache putting my made small website in it, it openet front page, but when clicking on links, they do not work - show errors - file not found, etc. Something is not that easy here still.

I've personally never had that problem, as long as you put the files in a folder,
in the htdocs directory and use the path i.e ../images/logo.png ,
ResourceHacker is also useful to change the icon on demo.exe after you have renamed it.

I think this had something to do with endings index.php. I had to change the link front page to index.php ending but normaly it should work without this ending. So probaly thats the same for onther links.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.