PHP APC Causes Segmentation fault

General Discussion of atomic repo and development projects.

Ask for help here with anything else not covered by other forums.
xetic
Forum User
Forum User
Posts: 9
Joined: Tue Sep 21, 2010 5:45 pm

PHP APC Causes Segmentation fault

Unread post by xetic »

RHEL5.5 - Plesk - ASL - PHP 5.2.17 - Zend Optimizer v3.3.9 - All system updates applied.

Hello,

I was just reading through some tutorials on caching and found apc_store function of php-pecl-apc package and decided to give it a shot. It installed just fine and phpinfo() showed it running with no errors in httpd/error_log.

When I test it with the example from php.net:

Code: Select all

$bar = 'BAR';
apc_store('foo', $bar);
var_dump(apc_fetch('foo'));
Apache crashes with seg faults and no explanation of why in httpd/error_log:

Code: Select all

[Wed Jan 12 21:48:40 2011] [notice] Apache/2.2.15 (Unix) DAV/2 mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 Apache mod_jk/1.2.15 mod_perl/2.0.4 Perl/v5.8.8 configured -- resuming normal operations
[Wed Jan 12 21:48:46 2011] [notice] child pid 15867 exit signal Segmentation fault (11)
.. Clipping 17 more of these lines ..
[Wed Jan 12 21:49:28 2011] [notice] child pid 15963 exit signal Segmentation fault (11)
[Wed Jan 12 21:49:28 2011] [notice] caught SIGTERM, shutting down

If trying to reproduce this make sure to follow this advice after installing php-pecl-apc package:

APC now requires memory cache sizes to be specified with an M or G or it may cause segmentation faults and will leave you an error in your log files warning you of this.

Change in /etc/php.d/apc.ini

Code: Select all

apc.shm_size=32
to:

Code: Select all

apc.shm_size=32M
I did have a crash from the above and it was clearly noted in my error log why. After changing this and stopping / starting Apache when I tried the example php code a similar crash happened but with no warnings about configuration problems or anything at all except the excerpt above.
biggles
Forum Regular
Forum Regular
Posts: 806
Joined: Tue Jul 15, 2008 2:38 pm
Location: Sweden
Contact:

Re: PHP APC Causes Segmentation fault

Unread post by biggles »

Have you tried it without Zend?
xetic
Forum User
Forum User
Posts: 9
Joined: Tue Sep 21, 2010 5:45 pm

Re: PHP APC Causes Segmentation fault

Unread post by xetic »

At least one of my clients uses a few site packages that require Zend so I don't see this as an option. I would rather not use apc if I had to choose.
BruceLee
Forum Regular
Forum Regular
Posts: 879
Joined: Sat Mar 28, 2009 6:58 pm
Location: Germany

Re: PHP APC Causes Segmentation fault

Unread post by BruceLee »

Well, than you have to use another cache optimizer.
Or try to enable Zend Optimizer only for that domain or viceversa APC for all domains except the one with zend.

Funny is that always other things are blamed but not Zend.
Back in time Zend has not worked with
-suhosin
-APC
-eaccelerator
and god knows what else.
Zend is the culprit.
Post Reply