PHP Startup: Unable to load dynamic library php_msgpack_serialize
Asked Answered
A

7

6
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/memcached.so' - /usr/lib/php/20131226/memcached.so: undefined symbol: php_msgpack_serialize in Unknown on line 0

Earlier today, I enabled forwarding of messages to root@localhost on my server to beam back to my personal email.

I have been receiving the above error message at 30 minutes intervals since. Of course, I checked and there's a PHP session cleaning script attached to cron to run at 30 minutes interval.

I have been searching around but couldn't find any specific solution.

My setup:

  • memcached 1.4.25
  • PHP 7.0
  • nginx/1.10.0
  • mysql Ver 14.14 Distrib 5.7.13
  • Ubuntu Server LTS 16.04

The closest I found to my issue above was this: http://community.rtcamp.com/t/php-warning-error-php-msgpack-serialize/6262 but there's no answer on that thread.

Aliciaalick answered 23/7, 2016 at 21:10 Comment(0)
B
13

First you need to work out which PHP ini files are being loaded. From command line you can run php --ini. Technically apache/nginx can be running a different version, and you can look up using phpinfo(); exit(); test script if you want to view that one instead. As you're using cron, you're using the command line version anyway.

In one of these files you will find a line similar to:

extension="memcache.so"

If you don't need this extension at all, then just comment it out by prepending it with a ;:

;extension="memcache.so"

If you DO need the extension then it sounds like you need to rebuild this module. The easiest way is using PECL.

pecl install memcache

You might need to follow some instructions whilst running the install. Once it's done, you should be able to run php -v and it shouldn't output the same warning. If this has worked and you just see the php versions, you should restart nginx (if you need it on the website, the command line one should work instantly). :

sudo service nginx restart
Baran answered 26/7, 2016 at 12:49 Comment(2)
I realized what was triggering the error wasn't even what my servers were using with nginx. Deleted them all, and having peace of mind now. thanksAliciaalick
For Apache: "sudo service apache2 restart", without the quotes, will restart the server at the endAntiscorbutic
R
1

I guess you can get a help from a similar topic on the site here.

But briefly, one of your extensions is loading memcache and the path in that is not correct. You should find it in your php.ini and fix the path manually.

Rachealrachel answered 26/7, 2016 at 11:28 Comment(2)
and finding the exact extension calling the mecached is what I'm struggling to locate.Aliciaalick
Sorry for replying with such a delay. You can change modules as explained link here at address of /usr/lib/php/modules for Unix/Linux.Rachealrachel
A
1

It means there is an extension=... or zend_extension=... line in one of your php configuration files (php.ini, or another close to it) that is trying to load that extension : ixed.5.2.lin

Unfortunately that file or path doesn't exist or the permissions are incorrect.

Try to search in the .ini files that are loaded by PHP (phpinfo() can indicate which ones are) - one of them should try to load that extension. Either correct the path to the file or comment out the corresponding line.

Amylopectin answered 26/7, 2016 at 11:47 Comment(0)
Q
1

Check if msgpack extension is installed and enabled (php -i | grep msgpack).

It seems that PHP in Ubuntu is compiled with it by default.

If it's installed and enabled, then check you memcached extension. Maybe you are using it from a previous installation or something similar.

Queeniequeenly answered 26/7, 2016 at 12:17 Comment(1)
i see msgpack installed.Aliciaalick
A
1

tl;dr: I eventually had to clear everything PHP that is less than php7.0 from my server manually, along with their related cron jobs.

Long story:

Going through my running process (ps -aux | grep 'php'), I realized php5 is still in there running. Everything on my server uses PHP7, so that lingering process was redundant, plus there was a cron job that runs a session cleaning job on the php5 somewhere, using a script which goes looking for the so-called missing Memcached file.

After removing all phps that are less than php7 from system via apt, I also went in to delete all the existing folders that are less than php7 in /usr/lib/php5 and or /usr/lib/php/ along with their cron related jobs found in /etc/cron.d/php5 and or /etc/cron.d/php/

No more whining warnings from PHP session cleaning about memcache

Aliciaalick answered 26/7, 2016 at 14:38 Comment(0)
H
0

I was getting a similar error with memcache.so and I noticed there was a new version of memcache that was installed the moment the system ran 'pecl install memcache' (automatically that updated to the latest version). The new version caused that error so I had to change the version 1 version lower to pecl install memcache-4.0.5.2 and it worked. Thanks @Farkie for that insight, that's when I realized that there was a new version that just came out a few days ago and that was it!

Horsehair answered 12/12, 2020 at 5:13 Comment(0)
H
0

Just install msgpack extension and the error message should disappear:

apt install php-msgpack

You might also be missing igbinary extension:

apt install php-igbinary
Hein answered 24/10, 2021 at 19:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.