加载PHP扩展amqp和grpc时出现问题,PHP安装了自制软件和pecl扩展

y1aodyip  于 2023-10-15  发布在  PHP
关注(0)|答案(1)|浏览(117)

我通过pecl安装了amqp。文件夹2020

Build process completed successfully
Installing '/opt/homebrew/Cellar/php/8.2.11/pecl/20220829/amqp.so'
install ok: channel://pecl.php.net/amqp-2.1.0
Extension amqp enabled in php.ini
➜  ~ brew services restart [email protected]
Stopping `php`... (might take a while)
==> Successfully stopped `php` (label: homebrew.mxcl.php)
==> Successfully started `php` (label: homebrew.mxcl.php)
➜  ~ php -v

运行php -v显示以下问题。错误路径,不是20220829而是20200930

PHP Warning:  PHP Startup: Unable to load dynamic library 'amqp.so'
(tried: /opt/homebrew/lib/php/pecl/20200930/amqp.so
brvekthn

brvekthn1#

从PHP 8.0升级到8.2导致php.ini文件中的配置错误。我把extension_dir改成了extension_dir = "/opt/homebrew/lib/php/pecl/20220829",重新启动了php brew services restart [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection),一切都运行得很好。

相关问题