gRPC not installed in php extensions dir

222 views
Skip to first unread message

Frederik Feys

unread,
Aug 18, 2019, 11:30:01 AM8/18/19
to grpc.io

Hi everyone!

I installed gRPC with PECL on a mac running Mojave (latest OS). 

I get this error: 
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20160303/grpc.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/grpc.so, 0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-non-zts-20160303/grpc.so in Unknown on line 0


In Pear, the extension lib is set to /usr/lib/php/extensions/no-debug-non-zts-20160303. So I expect it to install the gRPC extension there. Indeed the dir shows no .so file. 


What can I do to install this extension in my php environment?


Thank you,

Fred

Stanley Cheung

unread,
Aug 19, 2019, 1:40:51 AM8/19/19
to Frederik Feys, grpc.io
On later versions of MacOS, we have seen issues involving "System Integrity Protection" not allowing user to install extensions without escalated permissions. Some blog post that talks about this: http://www.devinbaldwin.com/2018/09/27/how-to-install-xdebug-on-a-new-mac-including-mojave/

If you don't want to go that route, you might want to look into installing PHP extensions via homebrew.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/c48db803-c433-4dfe-829c-a4529deaf2ba%40googlegroups.com.

Fre Feys

unread,
Aug 19, 2019, 4:19:27 AM8/19/19
to Stanley Cheung, grpc.io
Thank you Stanley

I disabled the SIP in recovery mode, restarted the system. Installed using gRPC with homebrew. 

Still have the same error:
"PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20160303/grpc.so’ -….. “

What can I do?

Thanks 
Fred

Stanley Cheung

unread,
Aug 19, 2019, 6:07:00 PM8/19/19
to Fre Feys, grpc.io
Are you running the system-installed PHP binary, but tried to load homebrew-installed extensions? They have to go in pairs. 

If you install the extension via homebrew, you may need to find the extension grpc.so file within your homebrew installation directory.

In any case, are you able to install and use any other PHP PECL extensions? The grpc extension did not attempt to install itself to any special directory.

Fre Feys

unread,
Aug 20, 2019, 12:00:01 PM8/20/19
to Stanley Cheung, grpc.io
Tried to install a different extension (V8) using PECL

This gave me error:

configure: error: Please reinstall the v8 distribution or provide valid path to it
ERROR: `/private/tmp/pear/install/v8/configure --with-php-config=/usr/bin/php-config' failed

Fre Feys

unread,
Aug 20, 2019, 12:02:31 PM8/20/19
to Stanley Cheung, grpc.io
This is the error I get when installing gRPC through PECL (with sudo):

/private/tmp/pear/install/grpc/src/php/ext/grpc/byte_buffer.c:19:10: fatal error: 'php.h' file not found
#include <php.h>
         ^~~~~~~
1 error generated.
make: *** [src/php/ext/grpc/byte_buffer.lo] Error 1
ERROR: `make' failed

On 20 Aug 2019, at 00:06, Stanley Cheung <stanle...@google.com> wrote:

Stanley Cheung

unread,
Aug 20, 2019, 4:22:40 PM8/20/19
to Fre Feys, grpc.io
Looks like first you have to sort out your PHP installation first. PECL cannot find the standard PHP headers.

Stanley Cheung

unread,
Aug 27, 2019, 6:38:12 PM8/27/19
to Fre Feys, grpc.io

On Wed, Aug 21, 2019 at 1:18 AM Fre Feys <fre...@gmail.com> wrote:
Thank you. 

I run php 7 successfully on my local machine. What would you specifically sort out? What you mean with "PECL cannot find the standard PHP headers”. 
Reply all
Reply to author
Forward
0 new messages