Often times when a script is posted here, the term "full server path" is used. This is a confusing term for many people. In the midst of a script tutorial or instructions, the focus is usually kept to the script at hand, so this term isn't described at depth, but ends up being the cause for many a script-installation to fail. Here, I'll try to describe what it means (and hopefully remember to link back to this post in the future whenever I use that term)
In as simple terms as possible, "full server path" refers to where your file is in relation to the server your file is sitting on. This will almost always include directories that are NOT web accessible. It basically STARTS with the very root of your server and works down the folder/hierarchy chain from there.
You may wonder why I just don't hand over your particular server path and tell you to swap out the folder names. The problem is that many servers are set up differently. Depending on who you host with, what type of server it is, how it's organized – there can be huge variations.
There's a few things you can do to try and figure out what your server path is.
Option 1) Build first, read directions later.
Obviously, this is not completely recommended. LOL! But if you do happen to have a script running, and it's spitting an error out, pay close attention to the error messages. If the problem is with the path you've provided, the error will probably look like:
Warning: you did something wrong blah blah blah in /home/jsmith/public_html/myfile.php on line 10
Just a little side track about using error messages to help debug your scripts – it may be too simple to mention, but when you get errors like this, GO LOOK AT LINE 10! (or whatever line is mentioned in the first error) Examine it VERY carefully. If it looks okay to you, GO LOOK AT LINE 9! Then, GO LOOK AT LINE 11! If the line mentioned in the error isn't actually causing the problem, sometimes the *real* problem is occuring on the line before or after the line mentioned.
Okay, getting back on track. You see that path in bold. THAT, my friends, is your full server path to your file. If ANOTHER path is mentioned in the blah blah blah part – and it's missing some parts or directories that you see in bold – you've entered in the wrong path in your script. (and this could very well be the cause for the error in the first place!)
This is huge. I can't tell you the number of times people miss that very easy clue. PHP knows your server path! It's handing it to you on a platter. Listen to it.
Option 2) I repeat, PHP knows your server path! Listen to it. 😉
There is a great little function in PHP: phpinfo(). And actually, another sidetrack. If you're not sure if your server is running php or not, using this simple little function will tell you. Just create a file that has the following and nothing else in it, and upload it to your server:
<?php
phpinfo();
?>
Pull that page up in a browser, and you should get a TON of information about php, your server. It's pretty cool actually. And… this page will also tell you what your server path looks like! 😀
Once you have that page loaded up in your browser, find the variable "PATH_TRANSLATED" or "_SERVER["PATH_TRANSLATED"]" (I'm relatively sure that should show up on the majority of configurations – if there's a better variable you suggest, please feel free to correct me in the comments). The value of this variable will be the full server path to the file you're looking at. It will probably look like:
/home/jsmith/public_html/testphpinfo.php
or maybe even:
C:\wwwroot\myfiles\testphpinfo.php
Option 3) Hold my hand please
If you have a really nice host, that doesn't mind being bugged – you can also try directly asking them. If they don't get what you're asking for, you can explain you're trying to run a php script, and the instructions required your using the server path to the file – maybe even point them to this post. They'll probably hate me forever. LOL! (If you're one of these host providers, and there's more information I can provide that will help people – feel free to post it in the comments. If it's value is wide enough, I can modify this post and include it here)