Alright thanks for the quick answer!
And does the PHP need to run the socket server or are the C++ app supposed to do that?
Based on what you needed it would make sense for the C++ app to listen (be the server) and PHP to send the data to the server (client)