前言
前段时间使用alpine基础镜像,安装了nginx+php,但是源码安装php的时候没有开启很多扩展,这几天在实践php和rabbitmq实现延迟队列的时候,需要socket扩展,记录下安装的时候遇到的问题以及解决办法。
使用alpine基础镜像,安装nginx+php,然后构建新基础镜像_nginx:1.25.4-alpine 镜像地址-优快云博客
一、安装sockets扩展
1、进入php源码扩展目录,执行如下命令。
cd /root/php-8.3.3/ext/sockets
2、安装扩展,执行如下命令。
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
3、安装过程当中报如下错误。
make && make install
/bin/sh /root/php-8.3.3/ext/sockets/libtool --tag=CC --mode=compile cc -I. -I/root/php-8.3.3/ext/sockets -I/root/php-8.3.3/ext/sockets/include -I/root/php-8.3.3/ext/sockets/main -I/root/php-8.3.3/e