Root path
Posted by: jdonner (---.home1.cgocable.net)
Date: January 29, 2008 06:29AM

Hi,

In my pages the following path (in bold) links to a PHP file, in this case /counter/cview.php:

/home/user/public_html/counter/cview.php


How can I tell WAMP that the path /home/user/public_html/ has to be redirected to C:\wamp\www instead?


Is it some kind of alias that I need to set in the local Apache configuration? The problem is that it's had for me to describe this problem, which makes it difficult for me to find with Google what I'm looking for.

Any help is really appreciated.



Edited 1 time(s). Last edit at 01/29/2008 06:30AM by jdonner.

Options: ReplyQuote
Re: Root path
Posted by: yfastud (Moderator)
Date: January 29, 2008 01:29PM

On your hosting, they're using Linux, but here you install wamp on Windows, so the path /home/user/public_html/ is compatible w/ C:\wamp\www\

You don't need any alias for this; however, if you still confuse, you can pm or email me, I will provide more detail examples which is quite long to post in the forums, or better if you don't mind to send me your problem and purposes, I might be able to help you out

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Root path
Posted by: jdonner (---.home1.cgocable.net)
Date: January 29, 2008 05:15PM

yfastud, I think you understood me wrong. What I have in my HTML code is this complete path:

/home/user/public_html/counter/cview.php

When I open that same page locally with wamp installed and running I get a warning message:

Warning: include(/home/lncore/public_html/counter/cview.php) [function.include]: failed to open stream: No such file or directory

You say I don't need any alias, so how would you suggest to solve this problem?

Thanks for your help and if you feel the need to mail me, feel free to do so.

Options: ReplyQuote
Re: Root path
Posted by: yfastud (Moderator)
Date: January 29, 2008 07:52PM

He he... he he... ;-)

One of my 3 computers is running Ubuntu server, the other 2 are Vista Business and XP Pro, so while other users can see that I stated the truth, I guess the problem is you didn't try to replace path and test it

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Root path
Posted by: jdonner (---.home1.cgocable.net)
Date: January 29, 2008 08:23PM

Sorry yfastud, it was never my intention to be stubborn, so it's unfair of you to assume this and make fun of me.

You still don't understand what I'm asking, so obviously I wasn't clear enough.

I know I can change the path and change it to C:\wamp\www\, I already had it working like that before I posted this thread. My problem is that I have a lot of pages with paths like /home/user/public_html/ and changing these is a lot of work, not to mention that I have to change them again once I upload these pages to the server so that's why I am asking again; is there a workaround?

Options: ReplyQuote
Re: Root path
Posted by: yfastud (Moderator)
Date: January 29, 2008 09:00PM

Quote

Sorry yfastud, it was never my intention to be stubborn, so it's unfair of you to assume this and make fun of me.
Don't get me wrong, I did NOT make fun of you at all, just try to make things not so serious

For your situation, I suggest you use mod_rewrite to resolve that problem, and you should google for more info about it

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Root path
Posted by: jdonner (---.home1.cgocable.net)
Date: January 29, 2008 09:15PM

I can use mod_rewrite, I already considered that before you replied, but I'm pretty sure it can be done in the Aapche configuration.

I guess I have to find someone who knows more about Apache than you do, right? he he he

Btw, that's me making fun too, don't take it too serious either.

Options: ReplyQuote
Re: Root path
Posted by: yfastud (Moderator)
Date: January 29, 2008 09:44PM

He he... he he... ;-)
You're right, so maybe you should check it at apache sites and good luck w/ it

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Root path
Posted by: jdonner (---.home1.cgocable.net)
Date: January 30, 2008 03:26AM

Quote

For your situation, I suggest you use mod_rewrite to resolve that problem

I thought so too earlier, but we're both wrong; you can't use mod_rewrite on PHP includes.

Options: ReplyQuote
Re: Root path
Posted by: jdonner (---.home1.cgocable.net)
Date: January 30, 2008 04:12AM

I fixed my problem by changing all includes to:

include $_SERVER['DOCUMENT_ROOT'] . '/counter/cview.php';?>

It now works online and locally without having the need to make any changes.

Options: ReplyQuote
Re: Root path
Posted by: yfastud (Moderator)
Date: January 30, 2008 05:40AM

Nice, but it seems you have to edit to add that line to all associated files instead setting up mod_rewrite???

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Root path
Posted by: jdonner (---.home1.cgocable.net)
Date: January 30, 2008 08:16AM

Quote

Nice, but it seems you have to edit to add that line to all associated files instead setting up mod_rewrite???

Mod_rewrite doesn't work on PHP includes Yfastud because they are at file level, mod_rewrite only works at URL level, so I had not other choice. Wasn't that much work to fix it though.

Options: ReplyQuote
Re: Root path
Posted by: yfastud (Moderator)
Date: January 30, 2008 02:50PM

Oh my bad ;-)

In that case, can you use ssi instead?

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Root path
Posted by: jdonner (---.home1.cgocable.net)
Date: January 30, 2008 07:58PM

Yes, I could, although I still have includes inside PHP scripts, so I prefer this solution for now.

Btw, great piece of software this WAMP. I don't know why so many seem to have issues with it, as far as I can tell all the issues I had to deal with had nothing to do with WAMP but were pure Appache, PHP or MySQL issues.
I have it working with Dreamweaver, PHPDesigner (+ XDebug) and MYSQL manager and it's all working great, even when installed on my D: drive. If you were involved in the development, then all I can say is: wel done!

Options: ReplyQuote


Sorry, only registered users may post in this forum.