PHP absolute path problem...

Dave S EMAIL HIDDEN
Fri Mar 26 00:55:05 CET 2010


In fact, sorry to double-post, but this is undoubtedly it!

You've tried stripping down the $folderPath variable, but this isn't
where the problem is occurring.

The problem is occurring because of this line:

$serverPath = $_SERVER['DOCUMENT_ROOT'];

When you're "changing folder path to reflect the proper path" you're
working around the bug because on your deadmengods server the document
root variable is probably set to your user's default web directory,
whereas on your school's server it's probably globally set to
/srv/www/htdocs/

So you can perhaps ignore my previous points about using absolute
paths. Just drop that document root stuff out of there, because I
don't think you need it.

If you need something similar, there are variables that will tell you
the location of the currently running PHP file - parsing the output of
these is likely to prove more fruitful, if you really need to do it.

Try: $_SERVER['SCRIPT_FILENAME']

See: http://www.php.net/manual/en/reserved.variables.server.php

Right, that's it now, I'm off to bed!

Cheers,

~Dave

On 25 March 2010 22:19, Mikael Hansson <forums at deadmengods.com> wrote:
>The strange thing is that when I run this from my deadmengods.com server it's working
>properly (changing folder path to reflect the proper path)
> I've tried stripping down the folderpath step by step but none works.



More information about the music-bar mailing list