php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57161 exec_fname error when including file after having change CWD in a function
Submitted: 2006-07-28 11:59 UTC Modified: 2006-08-23 09:31 UTC
From: sperson at lfdj dot com Assigned:
Status: Closed Package: APC (PECL)
PHP Version: 5.1.4 OS: solaris
Private report: No CVE-ID: None
 [2006-07-28 11:59 UTC] sperson at lfdj dot com
Description:
------------
In some case we face this type of error :

Warning: filename: ok.inc, exec_fname: /path/exec_fname.php, filepath: /path/ok.inc in /path/exec_fname.php on line 7

but the ok.inc file exists and his content is being included,
so we should see no warning at all.

I tested with and without APC, it only occurs when APC is on.

Reproduce code:
---------------
main file /path/exec_fname.php :
-------------------------------
include 'bug.php';
include "ok.inc";
bug();
include('ok.inc');

lib file /path/bug.inc :
------------------------ 
<?php
function bug() {
	chdir('/');
}

dummy content file :
--------------------
<?php
echo 'OK';




Expected result:
----------------
OKOK

Actual result:
--------------
OK<br />
<b>Warning</b>:  filename: ok.inc, exec_fname: /path/exec_fname.php, filepath: /path/ok.inc in <b>/path/exec_fname.php</b> on line <b>5</b><br />
OK

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-17 04:01 UTC] spm at fostam dot franken dot de
Same problem with the new APC 3.0.11 with PHP 5.1.4 on Linux.
Could this be connected to the recent "Override ZEND_INCLUDE_OR_EVAL opcode" change?
 [2006-08-17 05:51 UTC] akorthaus at web dot de
This does not happen with APC 3.0.10, so it must have been introduced with APC 3.0.11.

With APC 3.0.11 I get the same error (PHP 5.1.4, Apache 2.0.53, Linux 2.4).
 [2006-08-17 07:11 UTC] akorthaus at web dot de
The problem seems to be caused by the following patch:

http://cvs.php.net/viewvc.cgi/pecl/apc/apc.c?r1=3.12&r2=3.13
 [2006-08-17 11:09 UTC] rasmus@php.net
Yeah, looks like that warning is just for debug purposes.  Missed that before.  I blame Brian!  ;)
 [2006-08-17 21:24 UTC] genner at adzu dot edu dot ph
how do i fix the said problem? 

will 3.0.12 be available today?
 [2006-08-17 21:48 UTC] rasmus@php.net
Just comment out that warning in apc.c and recompile.  Will hold off on 3.0.12 for a bit to see if there are any other issues that come up.
 [2006-08-18 00:20 UTC] genner at adzu dot edu dot ph
what code i need to comment to supress the error?
 [2006-08-18 02:25 UTC] rasmus@php.net
Hrm.. I thought that was pretty obvious.  Just grep for that warning text.  It is this line:

php_error(E_WARNING, "filename: %s, exec_fname: %s, filepath: %s", filename, exec_fname, filepath);
 [2006-08-21 16:49 UTC] tom at rochen dot com
I installed this latest version using the recommended installation instructions and it causes the servers load to go way out of control.  I watched the UNIX Load Average skyrocket to way past 50.00 and above.

I had to go back to version 3.0.10 to get server stability.
 [2006-08-21 18:00 UTC] rasmus@php.net
What does you apc ini config look like?
 [2006-08-21 23:11 UTC] andrew at andriven dot com
I'm running php 4.4.4 and commenting out that line didn't help (I had to backrev to version 3.0.10).

Thanks.
 [2006-08-23 09:31 UTC] sperson at lfdj dot com
line commented and bug resolved.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 06:01:30 2024 UTC