سؤال

Recently upgraded PHP and ran into the following error message while updating:

php_msgpack_serialize in Unknown on line 0

So first of all, never heard of this package. All searches for this package leads to a single PECL repo (which really doesn't mean anything either) - which has about zero mentions from the community.

A few more searches and I tracked the origin down to a repo for php-memcached-dev - a repository I've never seen or heard of.

Of course, I have heard of the actual memcached library repo: libmemcached

I tried looking for this module everywhere for a sign of it being a legit part of centos but i can't seem to get any good/reliable results.

Places I searched for any sign of this package and/or repository:

I don't want to seem paranoid here, but I'm not even sure if this is legit at this stage.

Shrug - I dunno. I'm keeping my server turned off though until I see something else. Anyone have some advice/input ?

For the paranoid (and yes, I found it from being a little bit myself), here is an ugly google search : php_msgpack backdoor (note: only has 2 3 search results. Check out the date in the 2nd 3rd. i haven't clicked it myself and would not recommend anyone else click it either) This seems to be a rkhunter search looking for the same file being reported above. Probably just a coincidence but who knows. Thought I'd push it out there anyways.

UPDATE: Well, long story short this turned out to be an issue with a version of PHP that was installed with Cent. It has been fixed with the latest version.

هل كانت مفيدة؟

المحلول

On Ubunu 16.04 with PHP 5.5 from the Ondrej-PPA (https://launchpad.net/~ondrej/+archive/ubuntu/php) I could solve the problem by installing the package php-msgpack:

sudo apt-get install php-msgpack

And than enabling the php-msgpack with

sudo phpenmod msgpack

Perhaps you ave to restart apache2 after that if you use it with PHP.

Than this error is gone:

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

نصائح أخرى

One last thing to check: msgpack extension must be loaded before memcached.

In my scenario extensions were loaded alphabetically and therefore memcached was loaded before msgpack. Php cli didn't work until I loaded msgpack before memcached.

Following commands solved my issue.

sudo apt-get install php-igbinary

sudo apt-get install php-msgpack

sudo service php7.3-fpm reload #Change to your version

Reference: https://laracasts.com/discuss/channels/forge/php-71-update-broken-memcached

If you land here in Oct 2020 because you're getting an error after upgrading and you're using the repository ppa:ondrej/php you need to install the specific version of msgpack because all-of-a-sudden memcached is looking for this shared object.

We're running php 7.3 from this repo and although php-msgpack was installed, we needed to install php7.3-msgpack (which wasn't needed until this upgrade). No need to "enable" it as mentioned in the accepted answer. Just restart php.

Two steps:

sudo apt install php7.3-msgpack
sudo systemctl restart php7.3-fpm.service

If your codebase doesn't use MsgPack, you can remove it from the php.ini and/or smaller files that mention it in the php.d/* subdirectories.

Well, long story short this turned out to be an issue with a version of PHP that was installed with Cent. It has been fixed with the latest version.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top