Forum Moderators: coopster

Message Too Old, No Replies

APC breaks relative includes

After installing APC, only absolute paths seem to work

         

tj programmer

6:02 pm on Apr 17, 2008 (gmt 0)

10+ Year Member



I recently installed APC, and APC seems to be working fine. Before installation, my website was working fine. However, after installation, including files seems to only work when I use the absolute path.

For example, the following works:

include('/var/www/vhosts/myhostname/httpdocs/application/library/Zend/Loader.php');

But this doesn't:
set_include_path(get_include_path() . PATH_SEPARATOR . '/var/www/vhosts/myhostname/httpdocs/application/library');
include 'Zend/Loader.php';

I get this message:
Unable to access /Zend/Loader.php in /var/www/vhosts/myhostname/httpdocs/index.php

I'm sure it's something small and stupid I'm missing, but I'd still like to be able to use relative path names at the moment. Any thoughts on what's wrong?

tj programmer

10:49 pm on Apr 17, 2008 (gmt 0)

10+ Year Member



OK, I guess what is happening is that the file is still being loaded, but messages are being generated as different paths are tried and the included file is not found (until it eventually is found).

This behavior is strange -- without APC, PHP doesn't generate 2 errors when it has to look in three different places to find the file (PHP tries /Zend/Loader.php ./Zend/Loader.php and then uses the include paths).

But with APC it does. I can suppress errors if I choose not to display errors, but for development I'd still like to see them. Any idea why PHP displays these errors when APC is loaded?