What's my server path?
An adult webmaster article...
Written by Tom from Tom's Newbie Booster
WHAT'S MY PATH, DAMNIT???
Adult webmasters, probably more than any OTHER kind of webmaster, sooner or later have to get to grips with installing scripts. Scripts are just little computer programs that live and run on your webspace and can do anything from taking information from a visitor to fully automating a Paysite's day-to-day running). FACT: Installing these scripts is tricky to say the least! I'd say that 99.9% of all errors that occur when you're installing a computer script on your webspace is down to a wrong PATH somewhere.
Path - what the...?
Don't worry if a lot of this is starting to sound like one of your old school lessons - the ones where everyone slowly drifted into unconsciousness as the lecturer droned on about particles... This is pretty techy stuff here - and if you're new to HTML, the web, and so on - this is probably something that will come in handy in the future. But back to PATHs - when you install a web script, you need to tell the script where everything it needs IS on your server. It needs a path to follow to find out where IT is (crazy huh?) and, depending on what script this IS, where files are to be created and so on...
The SERVER PATH to a script is where is is in relation to the root folder. So,
/folder1/folder2/script/
It's a little like your hard disk, where you'd have a path of c:\websites\site1\ and so on, but we don't need to add c: or d: or any other drive letter there. (Sheesh! At least this script knows SOMETHING!) So a path is really just a map of the folders on this hard disk which would lead you to our script.
In reality, it's more likely to look something more like this:
/usr/tomarmst/htdocs/
Or something like that.
And then we hit problems.
I used to tell people that they could find out what their server path WAS just by using a simple trick. You'd log on using FTP and then just look at the path that appeared in the top right little window (this varies from FTP program to FTP program - but they should all show your server path somewhere. But since I started installing scripts for other people, I've realized that there's something WEIRD going on. That path that you see there is often NOT the real one. Sounds crazy right? Well, there's not much I can say about that - depending on how your webspace is set up (and this varies from hosting service to hosting service) this path will not be accurate and will NOT work if you use it in web scripts.
Let's find YOUR path...
Don't despair - there's a simple workaround that's fool-proof! As an exercise - we're gonna see what your server path is. We do this by uploading a simple, web script. This is a simple file with ONE line in it:
<?php phpinfo(); ?>
This is a special command which will display an amazing amount of information about our server. Information that will come in very handy as time goes by - no matter what kind of script you're installing.
To find out what your server path it, follow these simple steps...
1) Download THIS FILE.
2) Unzip the file by double clicking it (you'll need Winzip - http://www.winzip.com to do this).
3) You'll now have info.php on your hard disk.
4) Upload info.php to one of your domains.
5) Type in http://www.yourdomain.com/info.php - adding in your domain.
6) You'll now have a page filled with useful information. To find the server path, look at: DOCUMENT_ROOT. The path will be beside that.
You can copy and paste this to wherever you need to and add it in to your scripts.
Keep info.php handy - upload whenever you need to find what your SERVER PATH is.
TOM ^"^
Enter TOM'S NEWBIE BOOSTER
">