2 Answers
It depends on where the PHP script is running. Is it on a local server? Or hosted? If it’s on a Linux server you can use PHP to write to the log (https://www.php.net/manual/en/function.error-log.php) and then tail the log file.
The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software