I’m building a website using PHP for the front end and a continuously running Java service managing multiple instant messaging connections. Can these components communicate directly on a CentOS system without any intermediary web service?
hey, i ve played with sockets before. you can have php contact a java port directly. its a bit messy with error handeling and performance issues but it works if you get proper security measures setup. not the cleanest solution though.
Direct communication between a PHP frontend and a continuously running Java backend is technically possible but may require creating a custom interface that both components understand. In my experience, when system resources are not a major concern, you can use native socket communication to achieve this without an intermediary web service. However, handling errors, ensuring graceful degradation, and managing security typically become more challenging. A more robust method may involve implementing a lightweight API in Java that the PHP side can query, balancing direct integration with maintainability and security.