FAQ
I want to replace some Apache server using my custom http server
written in Go. Current Apache setup supports MySQL based vhosts. Most
of virtual hosts provides web services based on PHP.

I want to support any existing PHP scripts by forwarding HTTP requests
to php-cgi process running in Fast CGI mode. "net/http/fcgi" package
supports only responder role. Does anyone known any package that can
help to convert HTTP requests to Fast CGI requests?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Rémy Oudompheng at Mar 25, 2013 at 1:32 pm
    you can find a few ones by searching on godoc.org, I have one myself
    somewhere, you should probably open an issue to have an implementation
    in Go 1.2

    Rémy

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Vincent Vanackere at Apr 9, 2013 at 7:11 am
    Hi,

    I'm using a fork of the github.com/mrlauer/gofcgisrv package to do exactly
    the same task (in my case I am also planning to slowly migrate an existing
    PHP application). Please note that the original package does not support
    unix sockets and contains some annoying/critical bugs that can make large
    requests fail at random... The author of the package did not respond to my
    pull request (... yet ?), but in the meantime you can find my fork with the
    fixes at https://github.com/vanackere/gofcgisrv.


    2013/3/25 ziutek <ziutek@lnet.pl>
    I want to replace some Apache server using my custom http server
    written in Go. Current Apache setup supports MySQL based vhosts. Most
    of virtual hosts provides web services based on PHP.

    I want to support any existing PHP scripts by forwarding HTTP requests
    to php-cgi process running in Fast CGI mode. "net/http/fcgi" package
    supports only responder role. Does anyone known any package that can
    help to convert HTTP requests to Fast CGI requests?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Ziutek at Apr 9, 2013 at 10:02 am

    On 9 Kwi, 09:10, Vincent Vanackere wrote:
    I'm using a fork of the github.com/mrlauer/gofcgisrv package to do exactly
    the same task (in my case I am also planning to slowly migrate an existing
    PHP application). Please note that the original package does not support
    unix sockets and contains some annoying/critical bugs that can make large
    requests fail at random... The author of the package did not respond to my
    pull request (... yet ?), but in the meantime you can find my fork with the
    fixes athttps://github.com/vanackere/gofcgisrv.
    I tried this package with the same problems. I have no time to fix it
    or extend net/http/fcgi (it can be quiet easy because 50-75% of needed
    code is there).

    At last I temporary use net/http/cgi but (apart from CGI problems) it
    isn't well suited to call PHP interpreter with path to the real
    script. There is my code which seems to works well:

    fname := path.Join(dir, r.URL.Path)
    h := cgi.Handler{
    Path: phpBin,
    Dir: path.Dir(fname), // working directory
    Env: []string{
    "REDIRECT_STATUS=200",
    "SERVER_ROOT=" + dir,
    "DOCUMENT_ROOT=" + dir,
    "PHP_DOCUMENT_ROOT=" + dir,
    "SCRIPT_FILENAME=" + fname,
    "PATH_INFO=",
    },
    }
    h.ServeHTTP(w, r)

    where phpBin is path to the interpreter (eg. /usr/bin/php-cgi), dir is
    a directory where your scripts are.

    I definitely need to try your fork. Thanks!

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 25, '13 at 12:57p
activeApr 9, '13 at 10:02a
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase