wullxz
wullxz

Reputation: 19540

php fails loading xcache.so after recompile

I recompiled PHP 5.4.39 on my raspbian to include support for pthreads.
Everything works nice, even the pthreads, but every time I run a php script from commandline (and I guess it's the same if apache uses php), it says it's failing loading xcache.so:

Failed loading /usr/lib/php5/20100525+lfs/xcache.so: /usr/lib/php5/20100525+lfs/xcache.so: undefined symbol: compiler_globals

I recompiled php using this information: https://www.digitalocean.com/community/questions/enable-zts-support-on-ubuntu-14-04

Although php is running fine, I'd like to know what this message means and I'd like to solve it if possible.

Upvotes: 11

Views: 1226

Answers (2)

Jasper N. Brouwer
Jasper N. Brouwer

Reputation: 21817

You most likely have PHP extensions enabled that were built against an old build of PHP itself. The proper solution is to remove the incorrectly linked PHP extensions and rebuild them.

I suggest you start with the XCache extension (php5-xcache package on Ubuntu). Remove it and rebuild it by following the steps in the tutorial you mention (simply replace php5 with php5-xcache).

Most likely some other extensions will have issues too. Remove and rebuild them as well.

If you only followed the tutorial with php5 itself, it's safe to say you'll need to remove and rebuild all extensions. That's all packages starting with php5-.

PS: Not all PHP extensions support thread-safety. If you're unable to build a certain extension, but don't need it anyway, Simply uninstall it.

PPS: XCache is an opcode cache. Make sure you don't enable multiple opcode caches at the same time. For example, don't enable XCache and OPcache (or APC) together, but choose one.

Upvotes: 6

pinkal vansia
pinkal vansia

Reputation: 10330

In php.ini search for zend_extension , do a sudo updatedb in another terminal and then locate xcache.so and that's the path you should put in php.ini. If that doesn't solve it, you may be using incompatible xcache module. i.e. Using thread safe xcache with non thread safe php or vice versa.

Upvotes: 0

Related Questions