Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can not install GRPC on Mac OS X Mojave

Tags:

php

macos

grpc

pecl

I use the mac mojave and am trying to install the grpc:

sudo pecl install grpc

I use MAMP.

The triggered error is:

/ bin / sh /private/tmp/pear/install/pear-build-root9h4CAG/grpc-1.16.0/libtool --mode = compile cc -fvisibility = hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS = 0 -DNOMINMAX -DGRPC_ARES = O-1. -I / private / tmp / pear / install / grpc -DPHP_ATOM_INC -I / private / tmp / pear / install / pear-build-root9h4CAG / grpc-1.16.0 / include -I / private / tmp / pear / install / pear -build-root9h4CAG / grpc-1.16.0 / main -I / private / tmp / pear / install / grpc -I / usr / include / php -I / usr / include / php / main -I / usr / include / php / TSRM -I / usr / include / php / Zend -I / usr / include / php / ext -I / usr / include / php / ext / date / lib -I / private / tmp / pear / install / grpc / include -I / private / tmp / install / grpc / src / php / ext / grpc -I / private / tmp / pear / install / grpc / third_party / boringssl / include -I / private / tmp / pear / install / grpc / third_party / address_sorting / include -I / private / tmp / pear / install / grpc / third_party / nanopb -DHAVE_CONFIG_H -Wall -Werror -Wno-parentheses-equality -Wno-unused-value -std = c11 -g -O2 -D PB_FIELD_32BIT = 1 -c / private / tmp / pear / install / grpc / src / php / ext / grpc / byte_buffer.c -o src / php / ext / grpc / byte_buffer.lo mkdir src / php / ext / grpc / .libs  cc -fvisibility = hidden -DOPENSSL_NO_ASM -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS = 0 -DNOMINMAX -DGRPC_ARES = 0 -I. -I / private / tmp / pear / install / grpc -DPHP_ATOM_INC -I / private / tmp / pear / install / pear-build-root9h4CAG / grpc-1.16.0 / include -I / private / tmp / pear / install / pear -build-root9h4CAG / grpc-1.16.0 / main -I / private / tmp / pear / install / grpc -I / usr / include / php -I / usr / include / php / main -I / usr / include / php / TSRM -I / usr / include / php / Zend -I / usr / include / php / ext -I / usr / include / php / ext / date / lib -I / private / tmp / pear / install / grpc / include -I / private / tmp / install / grpc / src / php / ext / grpc -I / private / tmp / pear / install / grpc / third_party / boringssl / include -I / private / tmp / pear / install / grpc / third_party / address_sorting / include -I / private / tmp / pear / install / grpc / third_party / nanopb -DHAVE_CONFIG_H -Wall -Werror -Wno-parentheses-equality -Wno-unused-value -std = c11 -g -O2 -D PB_FIELD_32BIT = 1 -c /private/tmp/pear/install/grpc/src/php/ext/grpc/byte_buffer.c -fno-common -DPIC -or src / php / ext / grpc / .libs / byte_buffer.o /private/tmp/pear/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

Can someone help me?

like image 546
Herton Vilarim Avatar asked Dec 03 '18 00:12

Herton Vilarim


1 Answers

You have to install (if you already didn't) the command line tools

xcode-select --install

And also add the headers (they are not added in Mojave)

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

Credit to @donatJ - https://stackoverflow.com/a/52612102/649915

like image 68
Maciuca Doru Avatar answered Nov 12 '22 22:11

Maciuca Doru