Welcome Guest!

If you do not have an account yet on The Web Squeeze forums, please Register! It’s FREE and there are many benefits:

  • Receive Fast Advice
  • Learn Programming Languages
  • Get Professional Website Reviews
  • Quick Troubleshooting Assistance

> Finding Out The Server_root_path?

This is a discussion on Finding Out The Server_root_path?, within the Website Hosting section. This forum and the thread "Finding Out The Server_root_path?" are both part of the Hosting Your Website category.

 
Reply to this topicStart new topic
> Finding Out The Server_root_path?
edd
post Apr 10 2008, 12:33 PM
Post #1


Fresh Squeezed
**

Posts: 15
Joined: 18-March 08


I have been asked to try and fix a friends' website. It just stopped working all of a sudden, no files were changed.

He uses fasthosts shared servers, and I suspect the server details have changed at their end, as his site has a config file setting all the root paths and this would explain why it no longer works.

So, does anyone know how I can find out what the server_root_path would be? It is currently set to something like /home/server/g/domain.com/htdocs

Thanks.
Go to the top of the page
 
+Quote Post
Marc
post Apr 10 2008, 01:41 PM
Post #2


Squeeze Machine
*****

Posts: 574
Joined: 13-February 08
From: Scotland, UK


<?php $_SERVER['REQUEST_URI']; ?>


--------------------
Thanks,
Marc
Go to the top of the page
 
+Quote Post
Jason
post Apr 11 2008, 03:02 AM
Post #3


Master of the Universe
Group Icon

Posts: 1,298
Joined: 15-February 08
From: London, England


<?php print getcwd(); ?> will return /path/to/web/folder/on/host/

I think this is what you are after.


--------------------
Go to the top of the page
 
+Quote Post
Marc
post Apr 11 2008, 03:15 AM
Post #4


Squeeze Machine
*****

Posts: 574
Joined: 13-February 08
From: Scotland, UK


QUOTE (Jason @ Apr 11 2008, 09:02 AM) *
<?php print getcwd(); ?> will return /path/to/web/folder/on/host/

I think this is what you are after.


Thats the correct function.. smile.gif


--------------------
Thanks,
Marc
Go to the top of the page
 
+Quote Post
rewake
post Apr 11 2008, 10:09 AM
Post #5


Rapid Squeezer
Group Icon

Posts: 239
Joined: 14-February 08
From: NY, USA


<?= $_SERVER['DOCUMENT_ROOT']; ?>

I think some servers may restrict getcwd() because it deals with the file system, but either one of the two should so the trick.

I would contact the host and see if and what they have changed... helps looking for the problems easier!

Rich


--------------------
QUOTE
if ($name=='will') echo '/(bb|[^b]{2})/';

Raineri Jewelers | MySpace | Facebook | deviantART
Go to the top of the page
 
+Quote Post
If you found The Web Squeeze to be helpful, please donate so we can keep this site FREE, FRESH, and fortified with Web Design & Development info!
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: