kitech / php-go

Write PHP extension using go/golang. Zend API wrapper for go/golang.
882 stars 108 forks source link

Can't build on MacOS php 7.1 #35

Open sergeycherepanov opened 6 years ago

sergeycherepanov commented 6 years ago

Hi, I can't build it on my mac (10.13.4)

make failed with:

PHPCFG=/usr/local/bin/php-config make
go install ./zend
go build github.com/kitech/php-go/zend: invalid flag in #cgo LDFLAGS: -undefined
make: *** [all] Error 1

go version

go version go1.9.5 darwin/amd64

With 1.8 and 1.10 I had same result

php version

PHP 7.1.14 (cli) (built: Apr 23 2018 16:42:08) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.14, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

What I do wrong?

php-cpm commented 6 years ago

I think maybe you should use php 5.6 for developing

sergeycherepanov commented 6 years ago

Hi @php-cpm

I tried with 5.6 but receive same error

PHPCFG=/usr/local/bin/php-config make
go install ./zend
go build github.com/kitech/php-go/zend: invalid flag in #cgo LDFLAGS: -undefined
make: *** [all] Error 1

php version

PHP 5.6.33 (cli) (built: Apr 23 2018 16:17:10)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
beatscode commented 6 years ago

@SergeyCherepanov How do you make out? Did you ever come up with a solution? @php-cpm are you suggesting that building with php 5.6 will also work for a php7 codebase?

garyshow commented 6 years ago

same question mac php7.2

PHPCFG=/usr/local/bin/php-config make go install ./zend go build github.com/kitech/php-go/zend: invalid flag in #cgo LDFLAGS: -undefined make: *** [all] Error 1

sergeycherepanov commented 6 years ago

@beatscode It works under linux, currently it's enough for me.

boneq commented 6 years ago

go install ./zend go build github.com/kitech/php-go/zend: invalid flag in #cgo LDFLAGS: -undefined make: *** [all] Error 1

Albert-Zhan commented 5 years ago

go高版本cgo编译问题: go 1.8.7, 1.9.4, and 1.10以上版本需要在Makefile加上export CGO_LDFLAGS_ALLOW=. ` export CGO_LDFLAGS_ALLOW=.
export CGO_LDFLAGS := $(LDFLAGS) $(CGO_LDFLAGS) `

514366607 commented 4 years ago

export CGO_LDFLAGS_ALLOW=.* export CGO_LDFLAGS := $(LDFLAGS) $(CGO_LDFLAGS) CGO_LDFLAGS_ALLOW=.* go build

github.com/kitech/php-go/zend

In file included from ./goapi.go:5: ./array.h:1:10: fatal error: 'zend_API.h' file not found

include

^~~~ 1 error generated.