Jump to content

How do I figure out the "full path" to my directory


jodiellewellyn

Recommended Posts

All the following $_SERVER variables should contain your "full path":

 

$_SERVER["DOCUMENT_ROOT"]

$_SERVER["PHPRC"]

 

Also, you could always just make a file with a syntax error that will spit out an error with the full path to the file.

 

Something like...

 

<?php
foreach()
?>

 

... should generate an error.

 

PHP errors are so useful sometimes... :D

All the following $_SERVER variables should contain your "full path":

 

$_SERVER["DOCUMENT_ROOT"]

$_SERVER["PHPRC"]

 

Also, you could always just make a file with a syntax error that will spit out an error with the full path to the file.

 

Something like...

 

<?php
foreach()
?>

 

 

 

... should generate an error.

 

PHP errors are so useful sometimes... :D

 

Still a blank page... even with the error.

Your web host must have error reporting turned off:

 

Try this:

 

<?php
phpinfo();
?>

 

... and scroll down the "PHP Variables" section ...

 

 

The page certainly works...

But none of the codes is what I want...

Unless I have to put a few together

 

<?php
foreach($_SERVER as $name => $value){
echo $name . ": " . $value . "<br />";
}
?>

Put that in a test page, look for the one you want.

 

So I came up with this

PATH: /usr/bin:/bin

 

I'm just not sure where to get the rest.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.