0

I am creating a C++ app which must provide information to a PHP script running on the same box. I'm wondering what is the best way to connect the app with the PHP script?

I could create a simple HTTP server in C++, or I could create a tcp socket and listen for a connection (not sure what php offers for access to localhost ports), create a local domain socket, etc..

ideas?


The C++ program is a service that is constantly running, so I'm not sure exec from php makes sense. Unless you are suggesting I write a second executable that communicates with the services, and sends back results through stdout?

Also sounds like a lot of overhead to use exec

2
  • What about simple IPC methods as pipes? Commented Jan 28, 2014 at 10:35
  • Can I access IPC from my php script? Commented Jan 28, 2014 at 15:09

1 Answer 1

1

You could use the exec command.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.