edyan / docker-xhgui

An xhgui (with nginx, mongodb and php) container for profiling PHP Applications.
https://hub.docker.com/r/edyan/xhgui/
Apache License 2.0
25 stars 8 forks source link

Php5.6 : xhgui - Server at xhgui:27017 reports wire version 0, but this version of libmongoc requires at least 3 (MongoDB 3.0) #7

Closed Paulmicha closed 5 years ago

Paulmicha commented 5 years ago

After having successfully tested the Php7.2 version on a project, I've tried the Php5.6 on another project without success.

I'm using base image vixns/php-nginx:5.6-memcached (Debian Jessie) with the following Dockerfile (excerpt) :

RUN \
  pecl install xhprof-beta; \
  docker-php-ext-enable xhprof; \
  echo "extension=xhprof.so" > /usr/local/etc/php/conf.d/xhprof.ini

RUN \
  apt-get update && \
  apt-get install -t jessie-backports -y \
    build-essential pkg-config libssl-dev

RUN \
  pecl channel-update pecl.php.net && \
  pecl install -f mongodb && \
  rm -Rf /tmp/pear && \
  # Enable module mongodb
  echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongodb.ini && \
  docker-php-ext-enable mongodb

RUN \
  apt-get purge build-essential pkg-config libssl-dev -y && \
  apt-get autoremove -y && \
  apt-get autoclean && \
  apt-get clean

I've been trying different versions of the https://pecl.php.net/package/mongodb package, with no luck. Any idea what could be causing this error ?

Server at xhgui:27017 reports wire version 0, but this version of libmongoc requires at least 3 (MongoDB 3.0)

edyan commented 5 years ago

Hi @Paulmicha , I am not sure I can help, I am not the creator of xhgui.

My xhgui image is based on https://github.com/edyan/docker-php/blob/master/5.6/Dockerfile, so look at my dockerfile if you want to see how I do. The only thing I can say to help is that I install the repo's version of xhprof with the pecl mongodb extension.

As you use compiled version of php, try to install also some dependencies : https://hub.docker.com/r/briancw/docker-php-5.6-mongo/dockerfile/

Paulmicha commented 5 years ago

Thanks ! It worked using the dependencies and pecl package mongo (instead of mongodb) as in https://github.com/cleverly/docker-php-5.6-mongo/blob/master/Dockerfile