php-go
php-go copied to clipboard
Can't build on MacOS php 7.1
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?
I think maybe you should use php 5.6 for developing
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
@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?
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
@beatscode It works under linux, currently it's enough for me.
go install ./zend go build github.com/kitech/php-go/zend: invalid flag in #cgo LDFLAGS: -undefined make: *** [all] Error 1
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)
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 <zend_API.h> ^~~~~~~~~~~~ 1 error generated.