|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2007-07-01 13:43 UTC] sniper@php.net
  [2007-07-09 01:00 UTC] php-bugs at lists dot php dot net
  [2008-05-06 13:29 UTC] sev at kks-group dot ru
  [2008-08-09 22:00 UTC] diebar dot uy at gmail dot com
  [2008-08-09 22:04 UTC] diebar dot uy at gmail dot com
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 11:00:01 2025 UTC | 
Description: ------------ the *first* include will fail intermittently if apache2 virtual host is pointing to a symlinked DocumentRoot. problem is not easily reproducable and would occur perhaps 1 in 100 times, usually disappearing on refresh. this issue has gone away since reconfiguring the apache virtualhost's DocumentRoot to point to an absolute path instead of a symlinked one. a resolution was also found by setting an absolute path for the very first include within a script. Reproduce code: --------------- <? set_include_path($_SERVER['DOCUMENT_ROOT']); include('foo_include.php'); include('bar_include.php'); ?> Filesystem : /home/www -> /var/www Apache : <VirtualHost> DocumentRoot /home/www </VirtualHost> Expected result: ---------------- Occasionally observe the following : *Warning*: include(some_include.php) [function.include]: failed to open stream: No such file or directory in *foo_include.php* on line *blah* *Fatal error*: Call to undefined function foo_function() in *bar_include* on line *blah* ------------ ** noting that the first include fails but the second is ok. ** the include_path shown with this error will also point to the symlink path (/home/www in the 'reproduce code' example), not the symlink target. Actual result: -------------- code was added to dump the SERVER variables on include failure, keeping in mind the filesystem path is actually /var/www : *Warning*: include(required/connect.php) [function.include]: failed to open stream: No such file or directory in */var/www/moa/XXX/includes/required_includes.php* on line *7* *Warning*: include() [function.include]: Failed opening 'required/connect.php' for inclusion (include_path='/home/www/moa/XXX/') in */var/www/moa/XXX/includes/required_includes.php* on line *7* array(34) { ["nokeepalive"]=> string(1) "1" ["ssl-unclean-shutdown"]=> string(1) "1" ["downgrade-1_0"]=> string(1) "1" ["force-response-1_0"]=> string(1) "1" ["HTTP_ACCEPT"]=> string(87) "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*" ["HTTP_REFERER"]=> string(40) "http://moa.XXX.com/members_index.php" ["HTTP_ACCEPT_LANGUAGE"]=> string(5) "en-us" ["HTTP_UA_CPU"]=> string(3) "x86" ["HTTP_ACCEPT_ENCODING"]=> string(13) "gzip, deflate" ["HTTP_USER_AGENT"]=> string(89) "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)" ["HTTP_HOST"]=> string(15) "moa.XXX.com" ["HTTP_CONNECTION"]=> string(10) "Keep-Alive" ["HTTP_COOKIE"]=> string(42) "PHPSESSID=45f4ceaef2ff8824143aad70569ba022" ["PATH"]=> string(28) "/usr/local/bin:/usr/bin:/bin" ["SERVER_SIGNATURE"]=> string(0) "" ["SERVER_SOFTWARE"]=> string(102) "Apache/2.0.54 (Debian GNU/Linux) PHP/5.2.0-0.dotdeb.1 with Suhosin-Patch mod_ssl/2.0.54 OpenSSL/0.9.7e" ["SERVER_NAME"]=> string(15) "moa.XXX.com" ["SERVER_ADDR"]=> string(12) "1.2.3.4" ["SERVER_PORT"]=> string(2) "80" ["REMOTE_ADDR"]=> string(12) "4.5.6.7" ["DOCUMENT_ROOT"]=> string(22) "/home/www/moa/XXX/" ["SERVER_ADMIN"]=> string(18) "[no address given]" ["SCRIPT_FILENAME"]=> string(30) "/home/www/moa/XXX/menu.php" ["REMOTE_PORT"]=> string(5) "33073" ["GATEWAY_INTERFACE"]=> string(7) "CGI/1.1" ["SERVER_PROTOCOL"]=> string(8) "HTTP/1.1" ["REQUEST_METHOD"]=> string(3) "GET" ["QUERY_STRING"]=> string(11) "module_id=5" ["REQUEST_URI"]=> string(21) "/menu.php?module_id=5" ["SCRIPT_NAME"]=> string(9) "/menu.php" ["PHP_SELF"]=> string(9) "/menu.php" ["REQUEST_TIME"]=> int(1163034668) ["argv"]=> array(1) { [0]=> string(11) "module_id=5" } ["argc"]=> int(1) } *Fatal error*: Call to undefined function conn() in */var/www/moa/XXX/security/session.php* on line *109* on line *109*