Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

iamlux20's avatar

Upgraded PHP in Homebrew, now having errors

I have upgraded PHP version from 8.0 to 8.2. I'm now having these kinds of error for both grpc and imagick. How do I fix this?

Warning: PHP Startup: grpc: Unable to initialize module
Module compiled with module API=20200930
PHP    compiled with module API=20220829
These options need to match
 in Unknown on line 0
0 likes
2 replies
tisuchi's avatar

@iamlux20 Based on some results and information in the forum, this error is occurring because the version of PHP you are using (8.2) is incompatible with the grpc extension, which was compiled with a different version of the PHP API (20200930). To fix this error, you will need to recompile the grpc extension with the version of PHP that you are using.

You can do this by installing the PHP development tools (e.g. phpize) and then re-building the grpc extension from source. You can follow the instructions in the grpc documentation for more information on how to do this.

Similarly, you will need to recompile the imagick extension with the correct version of the PHP API as well.

Once you have recompiled both of these extensions with the correct version of the PHP API, the errors should disappear.

iamlux20's avatar

@tisuchi tried using phpize and I got confused where should I compile it as it is throwing me this error

Cannot find config.m4. 
Make sure that you run '/opt/homebrew/bin/phpize' in the top level source directory of the module

Please or to participate in this conversation.