PHP in Go. FastCGI?

I am writing a web server in Go that will replace an existing website. I still need old PHP scripts. Right now I have lighttpd + fastcgi. So I want my web server to call PHP as FastCGI.

What is the best way to handle this? I guess I need the Go FastCGI API.

http://golang.org/pkg/net/http/fcgi/ - It seems that it only supports the server side, not the client.

+4
source share
1 answer

I think you will need to make your own if you want to connect directly to the fastcgi process. Keep in mind that you still have to run the process manager / spawner anyway, so there wouldn’t be a huge leap to just run nginx and also have a Go proxy for PHP scripts.

You can also reasonably enable it and connect end users to nginx on port 80 and the nginx proxy server for your Go process or fastcgi as needed. One of the advantages of this is that the Go process can then be easily started as a different user than the root user.

+3
source

All Articles