1

When I run pecl install mysql_xdevapi in the terminal I get the following error:

configure: error: protobuf not found, please install it in system, consider use of --with-protobuf or setting MYSQL_XDEVAPI_PROTOBUF_ROOT

I then installed 'protobuf' via brew install protobuf. Running protoc --version gives me:

libprotoc 3.12.4

So it seems like 'protobuf' is installed. When I then run pecl install mysql_xdevapi again I get the same error that tells me 'protobuf' is not installed. I've tried pretty much everything I found in this post: Installing Google Protocol Buffers on mac but nothing seems to work.

I'm running macOS Catalina (10.15.6), PHP 7.3.20 (installed via brew).

Thank you very much in advance!

doefom
  • 66
  • 9

1 Answers1

0

I don't know if its to late, but after spending around six hours of my time on this I finally managed it to work. Apparently there is a bug in pecl package, so we must things by our hands.

If you really sure you have protobuf installed than continue or install it beforehand First you need to download package

pecl download mysql_xdevapi

Unzip a package and cd to unzipped directory

cd /usr/local/Cellar/php/8.0.9/include/php/mysql_xdevapi-8.0.26

You will see a folder and an XML file, cd to folder

cd mysql_xdevapi-8.0.26/

and locate file named config.m4. Find this line, it should be line number 416 but may vary

AC_CHECK_HEADER("google/protobuf/any.h", [], [PROTOBUF_INCLUDES_NOT_FOUND=1])

and change it to that

AC_CHECK_HEADER("google/protobuf/any.h", [], [PROTOBUF_INCLUDES_NOT_FOUND1=1])

then run

sudo phpize

what we just did is created a configure file for us now run created configure

./configure

Configuration should finish without errors

than run

make
make install

that's it!

Don't forget to add extension to php ini

extension="mysql_xdevapi.so"