Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming with apache php and java

Status
Not open for further replies.

imm102

Technical User
Oct 7, 2004
6
CH
hi,

sorry if this doesn't really fit into this forum but i was just wondering how ppl would go about solving a problem i have.

I have an apache server that runs a php script to retreive info from a mysql database. On the same machine as the server i want to add a stand alone application to control some external hardware im designing and also update the shared mysql dbase. My problem is i also want the php script be able to communicate with the application and give it commands. Not decided which language to use for the controller app, was considering java but my experience is limited.

Does anyone have any ideas how to achieve the communication and which language would be suitible so i can read up.

Cheers (i know its a long one sorry)
 
Any language that you know would be a decent choice. PHP doesn't have to run in the web server, you can write stand alone programs and run them from the command line. That would enable you to share code between the web app and the control app.

Personally, I think python is a much cleaner language and more enjoyable to program in. It's also very easy to incorporate C externals into a python module, which you may need if you're controlling hardware.
 
The php script is called remotely and the stand alone application runs continuously on the server machine. There needs to be some message passing between the php script that runs on request and the controller application. I have no experience of this so thats what i was really asking. Sorry if i was a bit vague.
 
look at msgsnd/msgrcv very nice tool to communicate between process'. On a fifo basis.
 
Are the php script and the control application running on the same machine?
 
Yep the application needs to run all the time so its functions couldn't be accomplished by the php alone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top