XCache 3.0, Apache 2.22.23, PHP 5.4.8 - xcache.so does not appear to be a valid Zend extension

4,715 views
Skip to first unread message

DaVe McComb

unread,
Nov 2, 2012, 6:55:11 PM11/2/12
to xca...@googlegroups.com
I've built Apache, PHP and XCache by hand but am having problems getting XCache 3.0 to load. XCache 2.0.1 loads with no problem. This happened with PHP 5.4.7 so I upgraded to PHP 5.4.8 but have the same issue.

When I have the following line in my php.ini file:
  extension = /usr/local/lib/php/extensions/no-debug-non-zts-20100525/xcache.so

I get the error message "/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xcache.so doesn't appear to be a valid Zend extension" and Apache will not start.

If I change this to:
   zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20100525/xcache.so

Apache starts, but the extension is not loaded. Here is the output of "php-cgi -v":

/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xcache.so doesn't appear to be a valid Zend extension
PHP 5.4.8 (cgi-fcgi) (built: Nov  2 2012 18:41:20)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd

If I compile version 2.0.1 it installs to the same location and works perfectly.

Any thoughts on what might be going wrong? I have tried this on two servers that have this issue. The other server is running PHP 5.4.8 and nginx.

Thanks.

xcache

unread,
Nov 2, 2012, 11:59:02 PM11/2/12
to xca...@googlegroups.com
> When I have the following line in my php.ini file:
> extension =
> /usr/local/lib/php/extensions/no-debug-non-zts-20100525/xcache.so
>
> I get the error message
> "/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xcache.so doesn't
> appear to be a valid Zend extension" and Apache will not start.
search xcache.so in your php ini files, you might have old settings left there
"extension = xcache.so" would be the right since 3.0

DaVe McComb

unread,
Nov 3, 2012, 8:46:52 AM11/3/12
to xca...@googlegroups.com
I only have one line:
   zend_extension = "/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xcache.so"

I deleted all the old lines and copied the xcache.ini just to make sure and did not have any luck.

As I mentioned, it works perfectly with 2.0.1 without any changes. If this helps, I compiled 3.0.0 with:

$ phpize --clean && phpize
$ ./configure --enable-xcache --enable-xcache-optimizer
$ make
$ make install

xcache

unread,
Nov 3, 2012, 10:19:05 AM11/3/12
to xca...@googlegroups.com
read release note
with 3.0, xcache.so is no longer a Zend Extension but a PHP extension
remove zend_extension = */xcache.so. load it using extension = ..
> --
>
>
>

DaVe McComb

unread,
Nov 4, 2012, 8:04:51 AM11/4/12
to xca...@googlegroups.com
Thanks, that does appear to work but only if I comment out the ioncube loader line in php.ini:

  ;zend_extension = /usr/local/ioncube/ioncube_loader_lin_5.4.so

If i try and load both ioncube and xcache, I get the error:

  PHP Fatal error:  [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0

If I comment out xcache, this works fine. It also works with xcache 2.

Are ioncibe and xcache 3 not compatible?

Thanks.

xcache

unread,
Nov 4, 2012, 9:01:35 AM11/4/12
to xca...@googlegroups.com
please edit xcache.c
find lines
typedef struct {
const char *name;
startup_func_t old_startup;
} xc_incompatible_zend_extension_info_t;
static xc_incompatible_zend_extension_info_t
xc_incompatible_zend_extensions[] = {
{ "Zend Optimizer", NULL }
};


change
{ "Zend Optimizer", NULL }
to
{ "Zend Optimizer", NULL },
{ "ionCube Loader", NULL }

recompile, reinstall. see if works for you without any problem at runtime
> --
>
>
>

DaVe McComb

unread,
Nov 4, 2012, 9:52:04 AM11/4/12
to xca...@googlegroups.com
Sorry, same error when the ioncube loader line is not commented out:

# php-cgi -v
PHP Fatal error:  [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0      

When I comment it out:

# php-cgi -v
PHP 5.4.8 (cgi-fcgi) (built: Nov  2 2012 18:41:20)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with XCache v3.0.0-dev, Copyright (c) 2005-2012, by mOo
    with XCache Optimizer v3.0.0-dev, Copyright (c) 2005-2012, by mOo
    with XCache Cacher v3.0.0-dev, Copyright (c) 2005-2012, by mOo

xcache

unread,
Nov 4, 2012, 9:54:07 AM11/4/12
to xca...@googlegroups.com
please paste output of php-cgi -v when XCache is not loaded while
ioncube loader is loaded. you need the exact name copy into the line i
told you
> --
>
>
>

DaVe McComb

unread,
Nov 4, 2012, 1:10:07 PM11/4/12
to xca...@googlegroups.com
# php-cgi -v
PHP 5.4.8 (cgi-fcgi) (built: Nov  2 2012 18:41:20)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
    with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
    with XCache v2.0.1, Copyright (c) 2005-2012, by mOo

And here is my xcache.c changes:

/* {{{ incompatible zend extensions handling */
typedef struct {
        const char *name;
        startup_func_t old_startup;
} xc_incompatible_zend_extension_info_t;
static xc_incompatible_zend_extension_info_t xc_incompatible_zend_extensions[] = {
        { "Zend Optimizer", NULL },
        { "ionCube Loader", NULL }
};

xcache

unread,
Nov 4, 2012, 9:01:08 PM11/4/12
to xca...@googlegroups.com
try
{ "ionCube PHP Loader", NULL }
> --
>
>
>

André Sanches

unread,
Nov 5, 2012, 8:13:52 AM11/5/12
to xca...@googlegroups.com
I had the same problem: "...xcache.so doesn't appear to be a valid Zend extension" and Apache will not start.". I solved changing the line zend_extension to extension (removing the "zend"), just like you said. I would like to ask if there is more thing that I would change in my old .ini file from Xcache 2 when upgrading to version 3.0.0 or if the ini can still be the same?

DaVe McComb

unread,
Nov 5, 2012, 8:28:23 AM11/5/12
to xca...@googlegroups.com
Sorry, that does not seem to work either:

# php-cgi -v
PHP Fatal error:  [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0                          

xcache.c:

/* {{{ incompatible zend extensions handling */
typedef struct {
        const char *name;
        startup_func_t old_startup;
} xc_incompatible_zend_extension_info_t;
static xc_incompatible_zend_extension_info_t xc_incompatible_zend_extensions[] = {
        { "Zend Optimizer", NULL },
        { "ionCube PHP Loader", NULL }
};

xcache

unread,
Nov 5, 2012, 10:32:36 AM11/5/12
to xca...@googlegroups.com
try { "the ionCube PHP Loader", NULL }
"the" was confusing :P
if this shot fail, i'll make some time to shot it myself

DaVe McComb

unread,
Nov 5, 2012, 2:16:30 PM11/5/12
to xca...@googlegroups.com
Unfortunately, no luck with that either. Thanks again for the help.

PHP Fatal error:  [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0

xcache

unread,
Nov 5, 2012, 9:42:39 PM11/5/12
to xca...@googlegroups.com
it's complicate. fixed in trunk @ 1163. can you please checkout trunk
version and try if it starts up. then check if encrypted php loads ok
btw, encrypted code may not be cached
> --
>
>
>

Shamil Nunhuck

unread,
Nov 18, 2012, 6:51:57 PM11/18/12
to xca...@googlegroups.com
Hi moo,

Yep, with the latest trunk version 1178, XCache 3.0.1-dev and ionCube 4.2.2 are loading -- well they are on my nginx + php-fpm server. 

Idan Shoukroun

unread,
Dec 10, 2012, 10:02:15 PM12/10/12
to xca...@googlegroups.com
Hi,

Where can I download xcache 3.0.1-dev?
I am having the same problem.

xcache

unread,
Dec 10, 2012, 10:04:04 PM12/10/12
to xca...@googlegroups.com

Idan Shoukroun

unread,
Dec 10, 2012, 10:15:30 PM12/10/12
to xca...@googlegroups.com
There are newer trunks, will it be ok to use 1190?

xcache

unread,
Dec 10, 2012, 10:18:22 PM12/10/12
to xca...@googlegroups.com
On Tue, Dec 11, 2012 at 11:15 AM, Idan Shoukroun
<idan.sh...@gmail.com> wrote:
> There are newer trunks, will it be ok to use 1190?
it's ok. latest trunk is 1190
lighttpd sort directory list in string instead of numeric way so 1*
come before 9*
> --
>
>
>

Pooya K

unread,
Jan 8, 2013, 1:31:28 PM1/8/13
to xca...@googlegroups.com
Hi

I just complied xcache-trunk-r1217.tar.gz but getting the same error: xcache.so doesn't appear to be a valid Zend extension

my setup: php 5.4.10,nginx,ubuntu12.04 32b,php-fpm

any help plz?

xcache

unread,
Jan 8, 2013, 9:27:39 PM1/8/13
to xca...@googlegroups.com
you didn't read Release note, not even this discussion thread
use extension=xcache.so to load instead of zend_extension=/path/to/xcache.so
> --
>
>
>
Reply all
Reply to author
Forward
0 new messages