Reply to Re: Required files confused between applications on same server

Your name:

Reply:


Posted by Rik on 07/29/07 16:52

On Sun, 29 Jul 2007 18:48:58 +0200, Ray <rod@iol.ie> wrote:

> On Jul 29, 5:14 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
>
>> On both. PHP has a 'current working dir', the files are searched in the
>> include_path, wich usually holds '.' (the current working directory),
>> and
>> possibly others. This current working dir is not the directory of the
>> file
>> that asks for an include/require, but usually where the process started.
>> It can be quite confusing when including several files, so to check what
>> the dir is you can use get_cwd();
>
> OK, I'm starting to understand. I've experimented a bit, and when I
> access the first app, getcwd() returns c:\windows\system32. However, I
> then access the other app, and then when I go back to the first, the
> working directory has changed to the root of the second app!
>
> I don't yet understand why the second changes the working directory,
> while the first doesn't....the only difference between them is that
> the first uses require() while the second uses require_once().

Impossible to tell without the code (and I must confess I try to stay
clear of IIS), but a simple chdir() will offcourse change the working dir.

--
Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация