Remote access
Whether source and destination server are on different networks and access to each other is remote, via internet, the most recommended is to use authentication via certificate.
On the server, the certificate must be mapped to a special user who has the access that the remote system needs.
Thus, the connection is encrypted and the communication is secure. In addition you ensure that only the remote server with that certificate will have access.
Internal network
If both systems coexist within an internal network, Intranet, you can use rules in the company’s proxy or firewall to filter permissible access.
An example would be to allow access to the URL of that service only from the server where the PHP system is located.
Considerations
In both cases, I mentioned techniques that delegate data authentication and privacy to recognised and common security solutions.
Avoid reinventing the wheel (which usually doesn’t work right), for example by creating your own encryption mechanism.
Hello, welcome to [en.so]! I think you need to be more precise in your question. These systems stay in the same internal network or live in separate places, being the communication via internet?
– utluiz
Sorry for the lack of details. The two systems are web, run in different networks and communication via internet only.
– hebertrfreitas