wodby / php

Generic PHP docker container images
MIT License
155 stars 103 forks source link

Support: Is it possible to install SNMP for PHP? #114

Closed mbomb007 closed 4 years ago

mbomb007 commented 4 years ago

In my Dockerfile, I have tried something like this:

FROM wodby/drupal-php:7.2-dev-4.12.12

# Install packages
RUN apk add --no-cache --update gcc g++ nodejs nodejs-npm ruby ruby-dev freetds-dev net-snmp

# Install php extension for SNMP
RUN docker-php-ext-install -j$(nproc) snmp

I can't get SNMP to install. Is it possible to install the snmp PHP extension starting with wodby/drupal-php, or would I have to use a different image base?

When run from CLI:

bash-4.4# docker-php-ext-install snmp
Configuring for:
PHP Api Version:         20170718
Zend Module Api No:      20170718
Zend Extension Api No:   320170718
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-musl
checking host system type... x86_64-pc-linux-musl
checking target system type... x86_64-pc-linux-musl
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20170718
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 1.1.1 (ok)
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for SNMP support... yes, shared
checking OpenSSL dir for SNMP... no
checking for net-snmp-config... no
configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.
csandanov commented 4 years ago

You can't install because you're missing snmp libraries: Could not find net-snmp-config binary