• Stars
    star
    217
  • Rank 176,565 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created over 11 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This package is built for Embedding PHP into Golang.

GoEmPHP

This package is built for Embedding PHP into Golang.

It is easy to use:

    script = php.New()
    script.Startup()
    defer script.Close() 
    if err := script.Eval("phpinfo();"); err != nil {
        log.Fatal(err)
    }
    if err := script.Exec("foobar.php"); err != nil {
        log.Fatal(err)
    }

For more examples, please read the souce code: php_test.go.

INSTALL

The first step is downloading the package. Please note that you must specify the param -d.

$ go get -d github.com/mikespook/goemphp

Then, following step is running bootstrap.sh to prepar the embeded PHP library. It has one paramater with 4 values: [5.4 | 5.5 | 5.6 | ng]

Eg.,

./bootstrap.sh 5.6

will wget, configure and make the libphp5.so file which can be used for embedding PHP.

It will be a long time waiting. When you see Congratulations!!!, it means you have already got the proper .so file placed in ./php-lib/libs/. You could check it manually.

The third step is calling go generate to prepare source files which will be built.

If generate process do not report any issue, then you could call go build to build GoEmPHP.

After that, please use ./test.sh for testing the package. And of course, you could run go test -ldflags="-r ./php-lib/libs/" manually, or put the .so into one of system library directories and run go test. The same library mechanism should be used when you use this library in your application.

Contacts

Open Source

See LICENSE for more information.

More Repositories

1

Learning-Go-zh-cn

ไธ€ๆœฌๅญฆไน  Go ่ฏญ่จ€็š„ๅ…่ดน็”ตๅญไนฆใ€‚
Go
2,640
star
2

gorbac

goRBAC provides a lightweight role-based access control (RBAC) implementation in Golang.
Go
1,509
star
3

gearman-go

This package is a Gearman API for Golang. It was implemented a native protocol for both worker and client API.
Go
288
star
4

gleam

An operation cluster based on MQTT
Go
54
star
5

golib

Go
52
star
6

ghoko

A web application that listens to web-hooks, scripted by Lua and written in Golang.
Go
38
star
7

possum

A micro web library for Go.
Go
19
star
8

wechat

Go
10
star
9

php_doozer

A Doozer extension for PHP
C
10
star
10

wc-api-golang

A Golang wrapper for the WooCommerce API.
Go
7
star
11

php_skynet

PHP Client and Server to Skynet
PHP
6
star
12

beacons

Beacons is a application that handling and passing data between systems, scripted by Lua and written in Golang.
Go
5
star
13

php-yaf-ppa

PHP-Yaf ppa source utils. Build .deb package for Ubuntu
Shell
5
star
14

schego

A lite weight schedule library for Golang
Go
3
star
15

raccoon

A simple web-spider framework driven by Golang and Lua.
Go
3
star
16

gpkg

This command provides a tool for searching and managing as well as querying information about golang packages.
Go
2
star
17

sortmap

SortMap illustrates how to build a sortable map in Golang. Also, this library can be used in a practical project.
Go
1
star
18

sts

STS: Secure Tunnel Server - a configurable and powerful ssh tunnel
Go
1
star
19

qrd

A HTTP service generating QR code
Go
1
star
20

RIP

Rest in peace, my friends. We will miss you.
1
star
21

dgg-ci

DGG-CI is a Docker, Git and Golang continuous integration environment.
Shell
1
star