5 ms·
Isn't this the case for any programming language if you run it through CGI?
by GranPC 8y ago
Isn't this the case for any programming language if you run it through CGI?
- roryrjb 8y agoYes this is first thing I thought about as well. Since PHP commonly uses FastCGI, using CGI via fcgiwrap as in the case of a cgit deployment for example, is basically the same sort of model, in a more modern sense.
- codedokode 8y agoThat would be pretty slow. FastCGI doesn't start a new process for every request unlike CGI.
- deleted 8y ago[deleted]
- noncoml 8y agoHow does it work for websockets? Do you have to spawn one process per connection?
- detaro 8y agoIn such cases, websockets generally aren't handled by the application itself, but by a server (e.g. the nginx in front of the app with plugins, or an extra server) that manages the connections, often provides "channels" and takes commands from the application.
- judge2020 8y agoYep, which is why Laravel [0], CakePHP [1], etc prefer to use a node app or separate server to handle WebSocket connections that then use an internal router to call PHP code. 0: https://laravel.com/docs/5.6/broadcasting#driver-prerequisites https://laravel.com/docs/5.6/broadcasting#driver-prerequisit... 1: https://github.com/scherersoftware/cake-websocket https://github.com/scherersoftware/cake-websocket
- toast0 8y agoMany languages aren't really suitable for CGI, because of long startup times, leading users of those languages to not tending to have a clean slate on every request, unless they work for it. (Alternatively, if you don't want a clean slate on every PHP request, you have to work for that)