Justtechjobs.com Find a programming school near you






Online Campus Both


php-install | 2003092

[PHP-INSTALL] How are absolute includes supposed to work? From: Karl Widde (kallewidell <email protected>)
Date: 09/30/03

Hi

I using PHP (CGI) 4.3.3 on a win2k server with IIS 5.0. Ive got a php.ini
with include_path = "f:\web\folderA\folderB\" and a Site defined in IIS with
that has the same home dir. If I try to include myFile2.php from
f:\web\folderA\folderB\folderC\folderD\myFile1.php using

  include("\folderE\folderF\myFile2.php"); - Dont work.

i get : "Warning: main(\folderE\folderF\myFile2.php): failed to open stream:
No such file or directory in
f:\web\folderA\folderB\folderC\folderD\myFile1.php on line 13"

if I move my

  f:\web\folderA\folderB\folderE\folderF\myFile2.php

to

  f:\folderE\folderF\myFile2.php

it does work.

i) I've tried using different doc_root, the same as site root folder and
unset - no result. phpinfo() shows the correct include_path.

ii) If I leave out the leading "\" in the desired include it does work - but
isn't this a non-absolute include?

  include("folderE\folderC\myFile2.php"); - works

1. Is this the expected and normal behaviour?

2. Using almost the same php.ini and setup (with php version 4.1.1 instead)
on another server I AM able to do the desired include. Can it be an IIS
issue? And if so what variables/settings/registry keys to look for.

3. (Tricky question) But if you were to look in php source files - what file
to look in to sort out how includes really work?