Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2016 10:38:37 +0200
From:      Niklaas Baudet von Gersdorff <stdin@niklaas.eu>
To:        freebsd-questions@freebsd.org
Subject:   Re: Unable to load dynamic library memcached.so
Message-ID:  <20161013083837.e26egzseoohj3se6@box-hlm-03.niklaas.eu>
In-Reply-To: <80df56c7-23e6-41da-06b6-5dca05e6f282@blackboxconsortium.com>
References:  <20161012212705.sm7lvgs2jkn5zv3c@box-hlm-03.niklaas.eu> <80df56c7-23e6-41da-06b6-5dca05e6f282@blackboxconsortium.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Orion Tiller [2016-10-12 16:59 -0700] :

> Not sure if this will help you here but I sometimes have an issue with
> redis where if the line extension=session.so isn't loaded first before
> the redis one in /usr/local/etc/php/extensions.ini I get a similar error
> to the one you are seeing.  The pecl-memcached port also lists these as
> requirements php56-json-5.6.26, php56-session-5.6.26

This helped a lot. I think I'm on the track to solve this.

I had the following folder structure:

  $ ls -l /usr/local/etc/php/

  total 28
  -rw-r--r--  1 root  wheel   18 Oct  4 05:16 ext-20-curl.ini
  -rw-r--r--  1 root  wheel   16 Oct  4 04:52 ext-20-gd.ini
  -rw-r--r--  1 root  wheel   18 Oct  4 06:37 ext-20-intl.ini
  -rw-r--r--  1 root  wheel   21 Oct  4 04:58 ext-20-sqlite3.ini
  -rw-r--r--  1 root  wheel   23 Oct 12 20:55 ext-30-memcached.ini
  -rw-r--r--  1 root  wheel   24 Oct  4 15:07 ext-30-pdo_sqlite.ini
  -rw-r--r--  1 root  wheel  505 Oct 12 21:54 extensions.ini

I assumed that ext-* are loaded before extensions.ini.

  $ grep -e json -e session /usr/local/etc/php/extensions.ini

  extension=json.so
  extension=session.so

Following json.so and session.so are loaded *after* memcached.so
which causes the error. So, I created a symlink that loads the
required *.so's first:

  $ ls -l /usr/local/etc/php/

  total 28
! lrwxr-xr-x  1 root  wheel   14 Oct 13 10:20 ext-00-extensions.ini -> extensions.ini
  -rw-r--r--  1 root  wheel   18 Oct  4 05:16 ext-20-curl.ini
  -rw-r--r--  1 root  wheel   16 Oct  4 04:52 ext-20-gd.ini
  -rw-r--r--  1 root  wheel   18 Oct  4 06:37 ext-20-intl.ini
  -rw-r--r--  1 root  wheel   21 Oct  4 04:58 ext-20-sqlite3.ini
  -rw-r--r--  1 root  wheel   23 Oct 12 20:55 ext-30-memcached.ini
  -rw-r--r--  1 root  wheel   24 Oct  4 15:07 ext-30-pdo_sqlite.ini
  -rw-r--r--  1 root  wheel  505 Oct 12 21:54 extensions.ini

Although now I get quite a lot of notices that extensions had
already been loaded, memcached loads without problems.

I suspect, this issue stems from the fact that I installed
lang/php56-extensions plus additional extensions individually,
such as curl, gd, intl, sqlite3, pdo-sqlite, and memcached.

To get rid of the notices the following two options should work.

  1. renaming (instead of symlinking) extensions.ini to
     ext-00-extensions.ini
     
  2. deleting lang/php56-extensions and installing the required
     ports individually

    Niklaas



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161013083837.e26egzseoohj3se6>