[SOLVED] Finding my Roots

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

[SOLVED] Finding my Roots

Post by $var »

Hello,

I have a lame question:

Path = F:\www\vhosts\domainname.com\httpdocs\access\00admin\
In my FTP, I can access \domainname.com\
But my index (and all files) are help in \httpdocs\

Which is considered the root?
$_SERVER['DOCUMENT_ROOT']."/Imi/City_Img/".$cityid."/".$aFile['name']
or
$_SERVER['DOCUMENT_ROOT']."/httpdocs/Imi/City_Img/".$cityid."/".$aFile['name']


I am looking to use mkdir, and it cannot make the path, despite permissions saying "create"
Last edited by $var on Wed Oct 05, 2005 9:44 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the first one.. DOCUMENT_ROOT is your web directory starting location..
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

Post by $var »

argh!!!!
why won't it make the directory?
*begins to cry*

Warning: mkdir(/Imi/City_Img/16): No such file or directory in F:\www\vhosts\blah.com\httpdocs\access\00admin\cities\add_city.php
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it would appear you aren't using the document root in that request or one of those directories doesn't exist so it can't create a subdirectory..
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

Post by $var »

mkdir($_SERVER['DOCUMENT_ROOT']."/Imi/City_Img/".$cityid);
am i missing a dot in there or something?
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

Post by $var »

I tried to echo the path to the server root, and the page is blank...
I think that $_SERVER['DOCUMENT_ROOT'] is at fault.

My Current PHP version: 4.3.10
Has anyone else had problem with this variable?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your server may not have document root set in the environment.. check if and where it is inside phpinfo()
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

Post by $var »

bingo!
doc_root no value no value

i contacted before you replied, but i will point this out.
they seem as apt to be hosting web sites as me,
i hope that they can fix it up.

feyd, i wish i could buy you a beverage for your endless help.
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

Post by $var »

Boo...
Stupid server company is a hack job if anything...

The dude says he doesn't know how to assign the root globally
(i think he means to the shared server solution)
It's a Microsoft server, which is the first problem,
and I don't think that they know what they are doing...

the perils or coming to an existing project.

does anyone know if this is possible, or am I going to have to assign the root manually on every page? Gah! Manual work.
Post Reply