Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php fails loading xcache.so after recompile

Tags:

php

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.

like image 550
wullxz Avatar asked May 05 '15 16:05

wullxz


1 Answers

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.

like image 132
Jasper N. Brouwer Avatar answered Sep 20 '22 11:09

Jasper N. Brouwer