在乌班图的服务器里面,在docker容器里面安装扩展,非执行dockerfile,然后执行步骤为
1. docker-php-ext-install pdo_mysql opcache sockets
docker-php-ext-enable sockets
pecl install event
docker-php-ext-enable event
2.执行最后一步也出现了
Warning: PHP Startup: Unable to load dynamic library 'event' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/event (/usr/local/lib/php/extensions/no-debug-non-zts-20200930/event: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20200930/event.so (/usr/local/lib/php/extensions/no-debug-non-zts-20200930/event.so: undefined symbol: socket_ce)) in Unknown on line 0
3.网上说event插件需要最后安装,我也是最后安装的,但是永远都会出现这个问题,
后面又在AI上面看到了这一步
echo "extension=event.so" >> /usr/local/etc/php/conf.d/docker-php-ext-event.ini
echo "extension=sockets.so" >> /usr/local/etc/php/conf.d/docker-php-ext-sockets.ini
加入后,还是一样的
Warning: PHP Startup: Unable to load dynamic library 'event' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/event (/usr/local/lib/php/extensions/no-debug-non-zts-20200930/event: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20200930/event.so (/usr/local/lib/php/extensions/no-debug-non-zts-20200930/event.so: undefined symbol: socket_ce)) in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'event.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20200930/event.so (/usr/local/lib/php/extensions/no-debug-non-zts-20200930/event.so: undefined symbol: socket_ce), /usr/local/lib/php/extensions/no-debug-non-zts-20200930/event.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20200930/event.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Warning: Module "sockets" is already loaded in Unknown on line 0
这个需要怎么去解决呢
你贴的那个 Issuse 里面,下面的那个解决方案是可以的呀,在 docker-php-ext-enable 的时候,指定一下
--ini-name
参数,利用命名规则,让 event 在 sockets 后面启用就好了。