Calling executables - server requests

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
masterminder
Forum Newbie
Posts: 1
Joined: Thu Jun 25, 2009 11:18 pm

Calling executables - server requests

Post by masterminder »

Hello,

I am looking for the best way to call an executable (written in C++).

In one case I want it to be running as a a demon (server) in order to hold information in memory.
What I did:
1. I created the demon and opened a socket from php to that demon. Done. (In fact I had two demons, one was receiving the request from php and the other executing after being called by the first demon.)

In the other case I would like to simply execute the (C++) program (executable).
1. I did ssh.
2. Socket.
3. exect()

I suppose solution 2. is still the best. Solution 1. is slower and 3. is neither safe not that attractive...

What are your experiences, would you have any suggestions?
It is supposed to hold a big load of requests.

Thanks in advance,
Theo
Post Reply