php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64202 500 Server error: With APC enabled "require" causes a huge back trace and exit
Submitted: 2013-02-13 07:56 UTC Modified: 2013-02-13 11:41 UTC
From: paul dot schwarz at mss dot co dot ke Assigned: gopalv (profile)
Status: Closed Package: APC (PECL)
PHP Version: 5.4.11 OS: Ubuntu 12.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: paul dot schwarz at mss dot co dot ke
New email:
PHP Version: OS:

 

 [2013-02-13 07:56 UTC] paul dot schwarz at mss dot co dot ke
Description:
------------
I'm not even sure if this is a bug, but after 2 days of searching for answers this 
is my last resort. Here is the trace: http://www.hastebin.com/raw/virowemuvo

I'm using spl's auto load register. It's working fine for a whole bunch of files. 
On one particular file it dies. I've cleaned out that file and made it as simple 
as <?php class Log{} ?> and it still dies. So the require is definitely failing.

Interestingly when I look at the apc.php dashboard, other files have cache hits of 
1, 2, 3 (as a press reload). But the file in question is always hit twice as many 
times, eg. 2, 4, 6.



Expected result:
----------------
With APC turned off the application runs and web pages load normally.

Actual result:
--------------
With APC turned on I get the following files loaded:

/home/vagrant/so-web/system/classes/I18n.php
/home/vagrant/so-web/system/classes/Kohana/I18n.php
/home/vagrant/so-web/system/classes/Config.php
/home/vagrant/so-web/system/classes/Kohana/Config.php
/home/vagrant/so-web/system/classes/Config/File.php
/home/vagrant/so-web/system/classes/Kohana/Config/File.php
/home/vagrant/so-web/system/classes/Kohana/Config/File/Reader.php
/home/vagrant/so-web/system/classes/Kohana/Config/Reader.php
/home/vagrant/so-web/system/classes/Kohana/Config/Source.php
/home/vagrant/so-web/system/classes/Arr.php
/home/vagrant/so-web/system/classes/Kohana/Arr.php
/home/vagrant/so-web/system/classes/Config/Group.php
/home/vagrant/so-web/system/classes/Kohana/Config/Group.php
/home/vagrant/so-web/system/classes/Log.php

and then suddenly on the last one, Log.php, I get the error. 
http://www.hastebin.com/raw/virowemuvo

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-13 08:02 UTC] gopalv@php.net
-Status: Open +Status: Feedback
 [2013-02-13 08:02 UTC] gopalv@php.net
This looks like APC has been compiled with __DEBUG__ mode on. The log message indicates it's from apc_main.c:598

apc_debug("1. h->opened_path=[%s]  h->filename=[%s]\n" TSRMLS_CC, h->opened_path?h->opened_path:"null",h->filename);

you need to compile it with ./configure --disable-apc-debug

Of course, unless you compiled it with debug to debug this issue. In which case move it back out of feedback.
 [2013-02-13 08:08 UTC] paul dot schwarz at mss dot co dot ke
-Status: Feedback +Status: Open
 [2013-02-13 08:08 UTC] paul dot schwarz at mss dot co dot ke
Thanks for the reply. So disabling debug will cause this issue to disappear or it 
will simply hide it and I will still have an underlying issue? Sorry, but I don't 
understand yet what's going on here. It seems like "require" has an issue.
 [2013-02-13 08:17 UTC] gopalv@php.net
The debug logs are written to the standard error output.

Kohana seems to read standard error and throw it as an exception

https://github.com/kohana/core/blob/3.3/master/classes/Kohana/Core.php#L984

So disabling the debug logs should remove the error.
 [2013-02-13 08:34 UTC] paul dot schwarz at mss dot co dot ke
Ok, to be clear, I'm installing APC using the php cookbook (you can see their 
apc example there):

https://github.com/opscode-cookbooks/php#example-1

Those "directives" seem like runtime configuration options. I'm wondering how 
chef works to install a non-debug version of APC.

Regarding Kohana, is this a showstopper? I'll speak to the #kohana guys later 
and see if they understand any work around.

Thanks.
 [2013-02-13 08:47 UTC] gopalv@php.net
I'm not really sure if that I know exactly what that runs, since APC does prompt for options when it is being installed.

pecl install APC

should prompt for the "enable debug mode" option & the default is "no"
 [2013-02-13 10:41 UTC] paul dot schwarz at mss dot co dot ke
Thanks. 

I ended up uninstalling it (it was installed using chef) and the re-installing 
manually and then just answered the prompts.
 [2013-02-13 11:41 UTC] gopalv@php.net
I'm guessing it works post-reinstall. Closing bug.
 [2013-02-13 11:41 UTC] gopalv@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: gopalv
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC