Re: Include fails when "./" is in front of file name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's the error I get:

*Warning*: include(.\file.inc.php)
[function.include<http://www.emsplannertest.com/function.include>]:
failed to open stream: No such file or directory in *
C:\Inetpub\httpdocs\test.php* on line *3*

*Warning*: include()
[function.include<http://www.emsplannertest.com/function.include>]:
Failed opening '.\file.inc.php' for inclusion
(include_path='.;.\includes;.\pear') in *C:\Inetpub\httpdocs\test.php* on
line *3*

This works fine on my old server which is running PHP 4.3.9.

I honestly feel like I'm overlooking some stupid tiny thing.  Are my
permissions correct?  Is it possible to debug this and look at the full path
of file.inc.php that PHP is trying to load?

Thanks!


On Mon, Apr 7, 2008 at 7:36 AM, Daniel Brown <parasane@xxxxxxxxx> wrote:

> On Sun, Apr 6, 2008 at 5:17 PM, Noah Spitzer-Williams <noahsw@xxxxxxxxx>
> wrote:
> > This works:
> >    include("file.inc.php");
> >
> >  This doesn't:
> >    include("./file.inc.php");
>
>    That's pretty vague, Noah.  Is it unable to locate the file?
> What's the error message you're receiving?
>
>    Also, what happens if you create two simple files in the same
> directory like so:
> <?php
> // file1.php
> echo "Okay.\n";
> ?>
>
> <?php
> // file2.php
> include(dirname(__FILE__).'/file1.php');
> ?>
>
> --
> </Daniel P. Brown>
> Ask me about:
> Dedicated servers starting @ $59.99/mo., VPS starting @ $19.99/mo.,
> and shared hosting starting @ $2.50/mo.
> Unmanaged, managed, and fully-managed!
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux