Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

library not found for -lphp7 #57

Open
naliferov opened this issue Sep 22, 2018 · 1 comment
Open

library not found for -lphp7 #57

naliferov opened this issue Sep 22, 2018 · 1 comment

Comments

@naliferov
Copy link

I use Mac OS. I got php7 installed.

 /usr/bin/php -v                
PHP 7.1.16 (cli) (built: Mar 31 2018 02:59:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

but when i execute "go get github.com/deuill/go-php" i getting this error:

# github.com/deuill/go-php
ld: library not found for -lphp7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
# github.com/deuill/go-php
engine.c:43:10: warning: enumeration values 'SAPI_HEADER_DELETE_ALL' and 'SAPI_HEADER_SET_STATUS' not handled in switch [-Wswitch]
engine.c:43:10: note: add missing switch cases
engine.c:97:2: warning: incompatible pointer types initializing 'void (*)(char *, int)' with an expression of type 'void (char *)' [-Wincompatible-pointer-types]
# github.com/deuill/go-php
receiver.c:79:1: warning: control reaches end of non-void function [-Wreturn-type]
# github.com/deuill/go-php
value.c:121:47: warning: incompatible pointer types passing 'unsigned long *' to parameter of type 'zend_ulong *' (aka 'unsigned long long *') [-Wincompatible-pointer-types]
../github.com/deuill/go-php/include/php7/_value.h:14:87: note: passing argument to parameter 'num_index' here
@deuill
Copy link
Owner

deuill commented Sep 26, 2018

Hi, in general, most PHP packages do not include the necessary libraries that Go needs to link against. Your best bet is either using the included Docker container (which you can build with make docker-image) for as your compilation environment, or compile PHP for Mac OS X with --enable-embed provided to the ./configure script.

You can also build go-php and link against a static version of the PHP library with the STATIC variable, and can also provide a specific PHP version to build against with the PHP_VERSION variable, e.g. make docker-build STATIC=true PHP_VERSION=7.1.22.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants