php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58186 fix:no relative paths in include paths
Submitted: 2008-05-03 10:39 UTC Modified: 2013-02-18 00:35 UTC
From: dankata5000 at yahoo dot com Assigned: pajoye (profile)
Status: No Feedback Package: APC (PECL)
PHP Version: 5.2.5 OS: Win xp
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: dankata5000 at yahoo dot com
New email:
PHP Version: OS:

 

 [2008-05-03 10:39 UTC] dankata5000 at yahoo dot com
Description:
------------
require emits a warning if require() relative path and apc.stat=0

This bug does not appear in Linux. Only in Windows/apache2.2
APC Version	3.1.0-dev
PHP Version	5.2.5
APC Host	localhost
Server Software	Apache/2.2.6 (Win32) PHP/5.2.5
Shared Memory	1 Segment(s) with 30.0 MBytes
(IPC shared memory, file locking)

Same result with apc 3.0.17-dev

Reproduce code:
---------------
test.php
----------
<?php
require 'apcinc.php';


apcinc.php
-----------
<?php
echo 'test';


Expected result:
----------------
test

Actual result:
--------------
Warning: require(C:\Program Files\Apache Software Foundation\Apache2.2\apcinc.php) [function.require.html]: failed to open stream: No such file or directory in C:\htdocs\php\test\apc_include.php on line 2
test

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-03 10:42 UTC] dankata5000 at yahoo dot com
The warning appears at the second execution of the script. It  expects the script in the apache's working directory.
 [2008-05-03 11:32 UTC] rasmus@php.net
Note that in apc.stat=0 mode, if you have relative path includes like this you are going to incur a realpath() call which is going to end up being much more expensive than the single stat in apc.stat=1 mode.  We do have include_path canonicalization as of 3.0.15, so if the file is relative to your include_path, it is ok, but otherwise you need to fix your includes in apc.stat=0 mode.
 [2008-05-03 12:34 UTC] dankata5000 at yahoo dot com
The fix is to remove any relative paths from the include path.
I had: 

include_path = ".;e:\PEAR\pear"

I changed it to:

include_path = "e:\PEAR\pear"

and now it works with no error.
 [2010-11-03 19:05 UTC] pierre dot php at gmail dot com
Please try using 3.1.5, DLLs are available here for http://www.php.net/~pierre/
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC