docker 中编译 PHP 的 event 扩展出错
问题描述
这是我编译好的镜像 salamandermh/php-cli:7.1 然后查看docker run -it salamandermh/php-cli:7.1 bash
发现
php -m
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/event.so' - Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20160303/event.so: php_sockets_le_socket: symbol not found in Unknown on line 0
[PHP Modules]
bcmath
bz2
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
imagick
json
libxml
mbstring
mongodb
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
redis
Reflection
session
SimpleXML
sockets
SPL
sqlite3
standard
swoole
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
php_sockets_le_socket: symbol not found in Unknown on line 0, 看样子是 sockets 扩展没找到,但是sockets扩展已经加载了,不知道是哪里没配置对
Dockerfile在这里
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了,是扩展加载顺序问题
because event was being loaded before sockets from the .ini's in /usr/local/etc/php/conf.d
Going into your image, the ordering of these files determines which are loaded first
docker-php-ext-enable
allows for a flag to change the.ini
name, so doing adocker-php-ext-enable --ini-name zz-event.ini event
has it load in last.正确的Dockerfile
github issue