Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the method of golang calling php7

Shulou Source: shulou.com Published: 2022-06-03 10:37:50 11月15日 Update

In this issue, the editor will bring you about the method of golang calling php7. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.

Golang calls php7

Use https://github.com/taowen/go-php7

Based on the modification of https://github.com/deuill/go-php, fork cause (https://github.com/deuill/go-php/issues/32)

Execute the php file func Test_exec (t * testing.T) {engine.Initialize () ctx: = & engine.Context {Output: os.Stdout,} err: = engine.RequestStartup (ctx) if err! = nil {fmt.Println (err)} defer engine.RequestShutdown (ctx) err = ctx.Exec ("/ tmp/index.php") if err! = nil {fmt.Println (err)}}

The content of / tmp/index.php is

Tags: Content output global method variable period that is life analysis influence special professional small and medium thing function memory rich content function function parameter Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Docker MariaDB Shulou Information Apple