Skip to content

kiancyc/gophp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

gophp

usage(on windows):

import (
    "net/http"
    "github.com/kiancyc/gophp"
)

func main() {    
    http.HandleFunc("/", func (w http.ResponseWriter, r *http.Request) {
    	gophp.Cgi(w, r, "C:/php/php-cgi", "E:/php/test.php")
    })
    http.ListenAndServe(":8080", nil)
}

test.php:

<?php
echo "Hello, {$_GET['name']}";

visit: http://localhost:8080/?name=John

Hello, John

About

launch php with golang (cgi mode)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages