PDA

View Full Version : Absolute Path To Forum


lufbra
August 2nd, 2007, 04:13 AM
I've been trying to install a modification on my forum/board. Part of the instructions says...

Open cms_conf.php and change the board_path value to the absolute path to your board (MUST HAVE ENDING SLASH)

How do I determine what the "absolute path" would be to the forum/board?

Buzz
August 2nd, 2007, 04:28 AM
Download the attached file here.
Change .txt to .php
Upload it to your forum directory
then call it in a browser (http://www.yoursite.com/forum/whereami.php)

It will spit out the absolute path to the file.

lufbra
August 2nd, 2007, 04:52 AM
Thanks Buzz, I've just tried this using this as the url...

http://www.daves-pub.com/forums/whereami.php

It just shows a white/empty page, the whereami.php file is uploaded to the forums directory.

Buzz
August 2nd, 2007, 07:37 AM
Try using this attched file.

The only thing I can think of is the form of line feeds in the file. They were set to Windows, which I suppose may effect a Unix server, though they shouldn't.

Other than that. It's just 1 line of php code.

oracle128
August 2nd, 2007, 08:43 AM
$_SERVER['PATH_TRANSLATED'] is unstable, and dropped in PHP5. Try getcwd() for a cheap n dirty alternative.

lufbra
August 2nd, 2007, 09:24 PM
Buzz, that one didn't work either. :(

Oracle, what are you trying to say I need to do?

Buzz
August 2nd, 2007, 09:31 PM
Oracle means to change the text in the whereami.php file between <?php and ?> to this: getcwd()

lufbra
August 2nd, 2007, 10:21 PM
Okay, I've got this inside the whereami.php file...

<?php getcwd() ?>

It's still a blank page when run through the browser...

http://www.daves-pub.com/forums/whereami.php

Buzz
August 2nd, 2007, 11:16 PM
Add a ; at the end


<?php getcw(); ?>

lufbra
August 2nd, 2007, 11:23 PM
Ack!!!

Now I'm getting this error....

Fatal error: Call to undefined function getcw() in /home/lufbra/public_html/forums/whereami.php on line 1

Or does this at least show that this is the absolute path...

/home/lufbra/public_html/forums/

?

Buzz
August 2nd, 2007, 11:26 PM
Yeah, not sure why you got the error unless the server isn't running PHP5 in which case the original file should have worked. But in any event that is the absolute path to your forums.

So it looks like you got it, in spite of all the problems with the file :)

lufbra
August 3rd, 2007, 03:28 AM
Yes, and thanks for the help here again. :)

The version showing through my cPanel is...

PHP version 5.1.6

oracle128
August 3rd, 2007, 05:44 AM
Buzz put a type in the code, he forgot the D in getcwd().
<?php getcwd(); ?>