Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Mar 02, 2011 7:19 am 
Offline
Senior Newbie

Joined: Wed Mar 02, 2011 6:51 am
Posts: 6
I have a Linode 512 with Ubuntu 10.10, Apache, MySQL, PHP with which I have installed php-apc to speed my Zend Framework application up a bit. Every so often, I'm pretty sure it's when I push the latest version of the source code to the server, I start getting APC errors notifying me of class redeclaration...

Code:
[Tue Mar  1 15:18:37 2011] [apc-error] Cannot redeclare class zend_locale_math in /var/www/foo/library/Zend/Locale/Format.php on line 301.


Different parts of the web application break each time this happens, and it can be fixed by removing and re-installing php-apc and the site runs fine again until the next lot of source code is pushed to the server (I think).

Does anyone have any ideas as to what might be happening, and how I could fix this properly?


Top
   
 Post subject:
PostPosted: Wed Mar 02, 2011 2:31 pm 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
I'm pretty sure you'd find out that just restarting your Apache (or the php-fastcgi process tree, if applicable) would be enough to fix it, no need to reinstall.
Bah, even erasing the cache using apc-info.php might be enough.
It has all signs of a bug in APC, and from time to time happens to me too, on Debian 5 (still). I'm not using Zend Framework, but it's the very same mixup of old and new versions of the file.

_________________
rsk, providing useless advice on the Internet since 2005.


Top
   
 Post subject:
PostPosted: Thu Mar 03, 2011 11:27 am 
Offline
Senior Newbie

Joined: Wed Mar 02, 2011 6:51 am
Posts: 6
Thanks for the tips rsk, I just forced it to happen again by updating some of the files and restarted Apache didn't appear to fix it, at least not straight away... I then tried clearing the cache with apc.php with still no immediate effect. After a couple of page refreshes it then started working again.

I'll have to look up the APC bug tracker and see if this is an issue.


Top
   
 Post subject:
PostPosted: Thu Mar 03, 2011 2:54 pm 
Offline
Senior Member

Joined: Thu Jul 22, 2010 8:23 pm
Posts: 60
are you running apc 3.1.7?


Top
   
 Post subject:
PostPosted: Thu Mar 03, 2011 4:54 pm 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
3.0.19 here. Ye Olde Debian. ;)

_________________
rsk, providing useless advice on the Internet since 2005.


Top
   
 Post subject:
PostPosted: Fri Mar 04, 2011 6:40 am 
Offline
Senior Newbie

Joined: Wed Mar 02, 2011 6:51 am
Posts: 6
I'm running 3.1.3p1 (with PHP 5.3.3-1ubuntu9.3) - I guess it would be a good idea to be running the latest version, though I'm not sure how easy this would be as I have installed with aptitude.

Would I need to remove with aptitude, then install manually from PECL?


Top
   
 Post subject:
PostPosted: Fri Mar 04, 2011 11:28 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Some might disagree with me, but it's best to stick to distro repo packages whenever possible. That said, Chris Lea maintains a few PPA repositories that have the latest version of php-apc for a variety of different versions of Ubuntu. No idea about the reliability/stability of his repo, but that'd be the easiest way to do it.


Top
   
 Post subject:
PostPosted: Fri Mar 04, 2011 11:43 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
What's the value of your "file_update_protection" when you do phpinfo()?

Also how are you running php? I've never seen this issue with apc.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Tue Mar 08, 2011 10:54 am 
Offline
Senior Newbie

Joined: Wed Mar 02, 2011 6:51 am
Posts: 6
obs wrote:
What's the value of your "file_update_protection" when you do phpinfo()?


This is set to 2.

obs wrote:
Also how are you running php? I've never seen this issue with apc.


It was installed with "apt-get install php5", as far as I'm aware, I haven't done anything to change the way in which it runs.


Top
   
 Post subject:
PostPosted: Tue Mar 08, 2011 12:22 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Run phpinfo() and does it say cgi/fastcgi or apache2 handler?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Mar 09, 2011 12:50 pm 
Offline
Senior Newbie

Joined: Wed Mar 02, 2011 6:51 am
Posts: 6
obs wrote:
Run phpinfo() and does it say cgi/fastcgi or apache2 handler?


Apache 2.0 Handler


Top
   
 Post subject:
PostPosted: Wed Mar 09, 2011 1:50 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
What's the output of
Code:
apache2 -m | grep mpm

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Thu Mar 10, 2011 6:19 pm 
Offline
Senior Newbie

Joined: Wed Mar 02, 2011 6:51 am
Posts: 6
Code:
root@wserv:~# apache2 -m | grep mpm
apache2: illegal option -- m
root@wserv:~# apache2 -M | grep mpm
apache2: bad user name ${APACHE_RUN_USER}
root@wserv:~# apache2 -l
Compiled in modules:
  core.c
  mod_log_config.c
  mod_logio.c
  prefork.c
  http_core.c
  mod_so.c


Top
   
 Post subject:
PostPosted: Thu Mar 10, 2011 6:32 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Hrmm don't see anything wrong with that then.

Try setting apc.stat to 0 in your php.ini, restart apache then see if the problem goes away.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Sat Mar 12, 2011 3:46 am 
Offline
Senior Member

Joined: Sat Mar 12, 2011 3:43 am
Posts: 76
Location: Russia
It's known bug of 'lazy' functions.
set
Code:
apc.lazy_functions = 0
apc.lazy_classes = 0


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
RSS

Powered by phpBB® Forum Software © phpBB Group