Unable to load dynamic library memcached.so
Niklaas Baudet von Gersdorff
stdin at niklaas.eu
Thu Oct 13 08:38:41 UTC 2016
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
More information about the freebsd-questions
mailing list