11 ms·
> You can install Node and have a basic server running in a few seconds. PHP requires installing and setting up a server tied into FPM... Without mentioning mo
by runjake 6mo ago
> You can install Node and have a basic server running in a few seconds. PHP requires installing and setting up a server tied into FPM...
Without mentioning more, the PHP equivalent to your Node example is `php -S`.
- chuckadams 6mo agoOr FrankenPHP, or hell, there's still even good old Apache. Or avoid the SAPI interface entirely with servers in PHP like Workerman, AMPHP, or Swoole. FPM is entirely too fussy for me to bother with: its error handling is atrocious (restarting in an infinite loop with no backoff is common), and no one really knows how to tune it.
- Gormo 6mo agoThose are great solutions for production deployment, but to the previous commenter's point, for iterating on your local machine during development work, nothing beats just running `php -S`. Launch the interpreter's built-in dev server in your project directory, load up localhost in your browser, work on your code, and testing incremental changes locally is just a matter of hitting F5.
- moebrowne 6mo agoBy default the dev server is single threaded, but since PHP 7.4 you can add more with an env: `PHP_CLI_SERVER_WORKERS`