Have you considered using MQTT?
Have a look here https://www.baldengineer.com/mqtt-tutorial.html for a setup on a Pi.
Another option would be to use UDP messages.
See here for a ESP UDP sender https://github.com/jxmot/ESP8266-udp
See her for a PHP UDP listener https://www.binarytides.com/udp-socket-programming-in-php/
I have used UDP in the past using a Python listener, easy peasy! Cannot offer you the code as disk trashed by Win 10!