mardi 26 mai 2020

Is there a way to know when the PHP -sever has is ready to serve requests?

One may start a local PHP server, e.g for testing:

php -S localhost:8080

One can also execute a PHP statement, e.g.

php -r "echo 'Hello';"

We initially hoped we could use this to tell when the server was started, i.e. using systemd-notify or some other process readiness protocol. However, using -r and -S together seems to ignore -r.

My question is thus, when starting a local server using php -S, is it possible to execute some code after the server is ready to receive incoming connections?

Aucun commentaire:

Enregistrer un commentaire