kitech / php-go

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

php7.1.2 error #24

Open robbinhan opened 7 years ago

robbinhan commented 7 years ago
PHP Warning:  PHP Startup: Unable to load dynamic library './hello.so' - dlopen(./hello.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: ./hello.so
  Expected in: flat namespace
 in ./hello.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library './hello.so' - dlopen(./hello.so, 9): Symbol not found: _zval_used_for_init
  Referenced from: ./hello.so
  Expected in: flat namespace
 in ./hello.so in Unknown on line 0
PHP Fatal error:  Uncaught Error: Call to undefined function foo_hello() in /Users/robbin/go/src/github.com/kitech/php-go/examples/hello.php:5
Stack trace:
#0 /Users/robbin/go/src/github.com/kitech/php-go/examples/hello.php(58): test_funcs()
#1 {main}
  thrown in /Users/robbin/go/src/github.com/kitech/php-go/examples/hello.php on line 5

Fatal error: Uncaught Error: Call to undefined function foo_hello() in /Users/robbin/go/src/github.com/kitech/php-go/examples/hello.php:5
Stack trace:
#0 /Users/robbin/go/src/github.com/kitech/php-go/examples/hello.php(58): test_funcs()
#1 {main}
  thrown in /Users/robbin/go/src/github.com/kitech/php-go/examples/hello.php on line 5

And php 5.6 is ok

mweibel commented 7 years ago

make sure to build using the correct php settings. you can point the PHPCFG env variable while building to the correct location. E.g. in my case: PHPCFG=/usr/local/php7/bin/php-config make

Otherwise it will use by default /usr/bin/php-config which in OSX's case is php5 and then you probably ran it with the php 7 version. Also the make clean doesn't clean up in the correct place if you use OSX.

kitech commented 7 years ago

merged master, give a try for free.