how to use a virtual server path, not a local one for include statements
Posted by: audg (---.ccc.edu)
Date: June 14, 2010 07:14PM

Hello,

This is a newbie question. I have looked through the documentation and searched the forum. I'm sure the answer is there, but cannot find it.

I just installed WAMP Server and wish to use it for a testing server for my real website. I copied some working files from my site to my local server to experiment.

On my server, I use the include statement: <?php $_SERVER['DOCUMENT_ROOT']."/path/is/here ?>

but the includes were not recognized with WAMP

I had to change the path to: <?php include ("c:/wamp/www/path/is/here ?>

but I'm sure this would not be necessary if I knew how to set an alias to the directory.

Thank you for the little "push" in getting me started!!!!!

Options: ReplyQuote
Re: how to use a virtual server path, not a local one for include statements
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: June 14, 2010 07:23PM

just try

<?php
echo $_SERVER['DOCUMENT_ROOT'];
?>

and see what its set to, it shud work.. but it can have different effects on windows compared to linux



also try



<?php
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
?>


this will show you the full array.. maybe ul see a path that suits u better.

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: how to use a virtual server path, not a local one for include statements
Posted by: audg (---.ccc.edu)
Date: June 14, 2010 07:49PM

Thanks for your help! That helped me realize that the problem was not the path...the problem was that I was using <? instead of <?php for some of my statements, and had not restarted php after enabling short open tags.

So thanks so much!

Options: ReplyQuote


Sorry, only registered users may post in this forum.