php-go icon indicating copy to clipboard operation
php-go copied to clipboard

Can't build on MacOS php 7.1

Open sergeycherepanov opened this issue 6 years ago • 8 comments

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?

sergeycherepanov avatar May 15 '18 23:05 sergeycherepanov

I think maybe you should use php 5.6 for developing

php-cpm avatar May 16 '18 09:05 php-cpm

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 avatar May 16 '18 09:05 sergeycherepanov

@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?

beatscode avatar Jul 29 '18 13:07 beatscode

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

garyshow avatar Jul 31 '18 03:07 garyshow

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

sergeycherepanov avatar Aug 06 '18 22:08 sergeycherepanov

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

boneq avatar Aug 11 '18 03:08 boneq

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)

Albert-Zhan avatar Dec 05 '18 02:12 Albert-Zhan

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.

514366607 avatar Apr 21 '20 08:04 514366607