caddy -version)?Caddy 0.11.1
Use php-5.6.40-nts-Win32-VC11-x64 on Windows 7 x64.
*:15156 {
gzip
on startup php-5.6.40-nts-Win32-VC11-x64\php-cgi.exe -b 15155 &
root web_root
fastcgi / 127.0.0.1:15155 php
}
start caddy with a windows services by winsw
just open browser and refresh quickly or kill php-cgi.exe by manual.
some times php-cgi.exe was crash or been killed. but caddy donot restart php-cgi.exe. so I can't access php file. [static html can access ok]
restart php-cgi.exe when php-cgi.exe was crash
The startup event only gets run at Caddy's startup time. It's not intended for it to keep a process alive. You should wrap your startup script with a simple batch script which can do the job of respawning php-cgi when you need it to, or use nssm (see here: https://github.com/mholt/caddy/wiki/Caddy-as-a-service-examples) to run it as a service to keep it alive.
Next time, please ask on https://caddy.community/ for any usage questions. This is the issues and bugs board.
That thread has info related to that: https://caddy.community/t/fix-php-cgi-exe-quits-after-exactly-500-hits-on-windows-or-502-bad-gateway-errors/4787
These details should be pinned or added to the docs. Took me some time to find how to do it and it's a common issue on Windows.
ok, thanks!
@magikstm maybe you could update the example here https://github.com/caddyserver/examples/tree/master/winphp with some more info
@francislavoie thanks for the suggestion. I created an issue on it https://github.com/caddyserver/examples/issues/147. And submitted a PR https://github.com/caddyserver/examples/pull/148.
Most helpful comment
That thread has info related to that: https://caddy.community/t/fix-php-cgi-exe-quits-after-exactly-500-hits-on-windows-or-502-bad-gateway-errors/4787
These details should be pinned or added to the docs. Took me some time to find how to do it and it's a common issue on Windows.