php handles paths in 2 different ways
A relative path
An absolute path
The relative path is pretty self explanitory (it grabs the files in relation to current file).
<img src = "images/myImage.jpg" />
absolute paths are a bit more complicated.
absolute paths are handled in two ways
a url
a directory.
Absolute paths always start with "/". This denotes the root of the directory. However, the root of the directory changes based on what you want to do.
if you want to link to a file such as an image or another html file then you must use the absolue url.
<img src = "/project/images/myImage.jpg" />
the base in this case is the project folder
otherwise if you want to access files for opening, writing, copying etc then you want to use the absolute directory.
fopen("/www_root/project/file.txt");
the base in this case is the folder that your server reads all the web files from.
(so it considers C:\www_root\ as your root)
I recommend using absolute paths over relative paths. It might be a headache at first but there's a lot of power to be had.