Re: help with require/includes pathing frustration

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

 



On Wed, Jan 28, 2009 at 22:15, Daevid Vincent <daevid@xxxxxxxxxx> wrote:
> At the very top of my login.php page I have this:
>
> <?php
> require_once('./includes/gui/gui_setup.inc.php');
> ...
> ?>
>
> (I've tried with and without the "./" prefix as if that might make a
> difference)

    Not that it will make a difference in this case, but instead of
"./", use something like <?php realpath(dirname(__FILE__)).'/'; ?>

> When I try to load the URL:
> https://example.com/vincentd/mydart/login.php
>
> I get this error:
>
> Warning: require_once(./includes/gui/gui_setup.inc.php)
> [function.require-once]: failed to open stream:
> No such file or directory in /home/www/vincentd/mydart/login.php on line
> 2

    1.) Note the name of the file required here.

> If I try to access it from the web:
> https://example.com/vincentd/mydart/includes/gui/gui_setup.inc.php

    2.) Note the name of the file requested here.

> vincentd@pse02 /home/www/vincentd/mydart/includes/gui $ ll
> -rw-rw-rw- 1 vincentd vincentd 11046 2009-01-29 01:17 gui_menu.inc.php
> -rw-r--r-- 1 vincentd vincentd  1589 2009-01-29 02:44 gui_setup.php

    3.) Note the names of the files located here.  ;-P

> Doesn't the ".:" in include_path='.:/usr/share/php:/usr/share/pear' mean
> that PHP should look in the current directory (which I assume would be
> "/home/www/vincentd/mydart") as that is where login.php is located?
> And then relative to there it should look in "includes/gui/..." as per
> my require_once command.

    You are correct, sir.  It's just a typo --- you merged the two
file names into one nonexistent file.

-- 
</Daniel P. Brown>
daniel.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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


[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