deuill / go-php

PHP bindings for the Go programming language (Golang)
MIT License
925 stars 105 forks source link

build error : go get -tags php5 github.com/deuill/go-php #38

Closed mirazero closed 7 years ago

mirazero commented 7 years ago

Hi, I encountered below error at build.

I added php library path '/usr/include/php' in '/etc/ld.so.conf' file. and then, i did execute this command line.

> go get -tags php5 github.com/deuill/go-php

What's wrong ?

[html@q352-0821 ~/goworkspace/src/github.com]$ go get -tags php5 github.com/deuill/go-php
# github.com/deuill/go-php/engine
In file included from include/receiver.h:15,
                 from deuill/go-php/engine/engine.go:14:
include/php5/_receiver.h:8: error: expected ';', ',' or ')' before '*' token
include/php5/_receiver.h:9: error: expected ';', ',' or ')' before '*' token
include/php5/_receiver.h:10: error: expected ';', ',' or ')' before '*' token
include/php5/_receiver.h:13: error: expected ';', ',' or ')' before '*' token
deuill commented 7 years ago

You don't need to edit /etc/ld.so.conf file or set -tags php5, as php5 is currently the default. Are you trying to build on Linux? If so, which distribution are you using?

If you're on an older version of Ubuntu or Debian, installing libphp5-embed and php5-dev should do the trick, otherwise you need to install libphp7.0-embed and php7.0-dev and build with -tags php7-debian. Other distributions can build against PHP7 with -tags php7.

deuill commented 7 years ago

Amendment to the above: PHP 7 is now the default, so building against PHP 5.x requires that you pass the php5 tag. Also, building against PHP 7 on Debian (or Debian-based distributions, such as Ubuntu) needs the debian tag only.