← Back to team overview

ius-coredev team mailing list archive

[Bug 723724] Re: APC 3.1.6 does NOT work with relative path in include()

 

I try to be more precise, the problem surfaces, if the current working
directory (eg. reported by getcwd()) is different from
dirname(__FILE__). That is not the case in your examples.

What I have is:

/user1
index.php --> /shared/index.php (symlinked from a different location)
config.inc.php (file with content <?php $config='user2';)

/user2
index.php --> /shared/index.php (symlinked from same location as of /user1/index.php)
config.inc.php (file with content <?php $config='user2';)

/shared/index.php
<?php
include './config.inc.php';
print_r($config);

now calling the two urls:

/user1/index.php
prints "user1"

/user2/index.php
prints "user1" too, as APC 3.1.6 uses the cached copy of /user1/config.inc.php for relative patch './config.inc.php' instead of "user2" specified in /user2/config.inc.php

[root@lighttpd ~]# rpm -qa php53u\*
php53u-cli-5.3.5-3.ius.el5
php53u-mbstring-5.3.5-3.ius.el5
php53u-common-5.3.5-3.ius.el5
php53u-mysql-5.3.5-3.ius.el5
php53u-pecl-apc-3.1.6-4.ius.el5
php53u-5.3.5-3.ius.el5
php53u-imap-5.3.5-3.ius.el5
php53u-ldap-5.3.5-3.ius.el5
php53u-mcrypt-5.3.5-3.ius.el5
php53u-xml-5.3.5-3.ius.el5
php53u-pecl-memcache-3.0.5-15.1 <-- NOT from IUS, which has only memcache-2!
php53u-pear-1.8.1-7.ius.el5
php53u-pdo-5.3.5-3.ius.el5
php53u-gd-5.3.5-3.ius.el5

[root@lighttpd ~]# pecl list
Installed packages, channel pecl.php.net:
=========================================
Package  Version State
APC      3.1.6   stable
memcache 3.0.5   beta

-- 
You received this bug notification because you are a member of IUS Core
Development, which is subscribed to IUS Community Project.
https://bugs.launchpad.net/bugs/723724

Title:
  APC 3.1.6 does NOT work with relative path in include()

Status in IUS Community Project:
  New

Bug description:
  APC 3.1.6 used in php53u-pecl-apc-3.1.6 package suffers from the following bug:
  http://pecl.php.net/bugs/bug.php?id=20529
  It causes includes with relative path to not use getcwd() / current working directory, but the directory of the script issuing the include/require statement. This bug is a real pain to debug, as it causes eratic failure in many php frameworks.
  APC 3.1.7 fixes the bug, so please update the packages to this version, even if it's marked beta, while 3.1.6 is marked stable, but is unusable!



References