Help with strange include problem in PHP 5.2.0

From: Date: Thu, 30 Nov 2006 12:49:35 +0000
Subject: Help with strange include problem in PHP 5.2.0
Groups: php.general 
Request: Send a blank email to php-general+get-245342@lists.php.net to get a copy of this message
Hi all, I have a strange problem including files in PHP 5.2.0 running on Unix. If I try to include a file using include 'filename.inc';, everything is fine. As soon as I try to put a "." in front of the file name, for example include './filename.inc';, I get a "failed to open stream: No such file or directory" error. Does anyone have any suggestions as to what is going wrong?` This all works with php 4.4.4 built with the same environment and compiler on the same system. thanks Markus The files I am testing are: include.php: <?php $result = include 'filename.inc'; echo "Result of first include = $result"; $result = include './filename.inc'; echo "Result of second include = $result"; $result = include './include_test_dir/filename.inc'; echo "Result of third include = $result"; ?> filename.inc: <?php echo "I am the included file..."; ?> # ls -l total 6 -rw-r--r-- 1 root webservd 44 Nov 30 13:45 filename.inc -rw-r--r-- 1 root webservd 265 Nov 30 13:45 include.php drwxr-sr-x 2 root webservd 512 Nov 30 13:44 include_test_dir # ls -l include_test_dir/ total 2 -rw-r--r-- 1 root webservd 21 Nov 30 13:45 filename.inc

« previous php.general (#245342) next »