Php: "../"

software development

#1

Hi Community,

I’ve been writing a pretty complex system with a lot of references to parent directories. I’ve found that I have to reference the ENTIRE path /username/domain.com/file.php for include functionality when working in subfolders and things like “…/file.php” won’t work. I do this all of the time on FreeBSD servers… is there something different in the format on Dreamhost?

ex: <? require_once("../file.php"); ?> doesnt work.

Thanks!


#2

Actually, that does work just fine for me. I just did the following test:

file hello.php:

<? echo "Hello World"; ?>

stored at /home/myuser/domain.com/hello.php

and file test.php:

<? require_once("../hello.php"); ?>

stored at /home/myuser/domain.com/dir/test.php

Runs without error and prints “Hello World” to the screen.

–rlparker


#3

Works fine for met to. Try chmod the included file to 777 to see if that’s where the error is