Goetz Lohmann wrote :

wich means that "testinclude.php" includes "inc/inc1.php"
and "inc/inc1.php" includes "inc/inc2.php" ?
Right. I'm sorry, I didn't modify testinclude.php as you suggested, but inc1.php. With a modified testinclude.php:
<? include ('./inc/inc1.php'); ?>
I get:
Failed opening './inc/inc1.php' for inclusion \
(include_path='.:..:/usr/local/php-4.3.0/lib/php')

Seems it doesn't like './' ("inc/inc1.php" is OK). I think that since the name begins with '.', PHP tries to find a file in the working dir, which is null (see below).

insert something like into inc1.php and inc2.php:

<?php
   echo "inc included<br>\n";
   echo "<br>\n";
   $folder=dir('inc');
   // print out folder "inc"
   while($datei = $folder->read()) {
      echo "$datei<br>\n";
   }
   $folder->close();
   echo "<br>\n";
?>
Unfortunately, this gives nothing. I guess this is because pathnames of files are relative to the working dir. There are only two variables, PATH and TZ in the environment of my Apache server, but nothing about a working dir: cwd() returns an empty string, and so does `pwd` or `ls`.
Relative pathnames of included files are apparently resolved through a special way, unless they begin with '.' or '..'. But this is not clearly described in the documentation, and it's a bit confusing.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to