Jump to content


Photo

problems creating aliases.


  • Please log in to reply
4 replies to this topic

#1 yaqub

yaqub
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 28 October 2006 - 12:32 AM

Hi -

I am trying to add aliases to my config file so I can follow along with Beg. PHP5 and MySQL E-Comm. I'm trying to add this


Alias /tshirtshop/ "c:/tshirtshop/"
Alias /tshirtshop "c:/tshirtshop"

But when I restart Apache(I'm using 2.0.59 by the way) and try to test I get an error page. I also have a test.php file that I'm trying to call. So my "url" is http://localhost/tshirtshop/test.php

Can someone give me a hand asap I really need this help fast, Im buiding a site and learning as I go starting off real good as you can see.

Now I have maybe fixed something. I rewrote the php code in Dreamweaver so now I don't get the 404 page cannot be found. Now I get a blank page. With this code if all is working properly should I see the php icon?.....

<?php phpinfo();?>

Cause like I said before rewriting the code I was getting an error page(notepad adding the .txt after .php) but now there's nothing displayed on the page. Even if I do a simple Hello World basic php script nothing get's displayed.

Any answers? I can email the config file if that will help.



Thanks

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 28 October 2006 - 10:56 AM

When you got to http://localhost/tshirtshop/test.php and right click and select view source do you see your PHP coding? If you do then Apache is not setup.

You need to setup Apache to parse PHP files with the PHP Interpreter. I have posted a few posts in this forum how to do this, such as this post.

#3 yaqub

yaqub
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 29 October 2006 - 12:31 AM

Hi-

Thanks for the reply. I did get it to display my php code which was just a date test if you will. But my main problem seems to be getting it to use an "aliase" I think. Right now what works is http://localhost/date.php, but the date.php file is in a folder called prorider. If I put http://localhost/prorider/date.php I get the usual cannot find page error. I've even tried http://prorider/date.php same message.

From what I think is that apache isn't recognizing that I have made prorider the "default" folder. Excuse me if my names or terms are wrong. Root folder is the correct way of putting it I guess. In the tutorial I was following we were supposed to add an alias in apache's config file which would be used as the virtual root folder(once again terms probably wrong).



#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 October 2006 - 12:43 PM

When creating an Alias you need to setup an Alias using the Alias directive, which you have done.

Then you need to have a corresponding directory directive, like so:
<Directory "alias-path-here">
    Directory saettings here
</directory>

For example for the tshirtshop alias you'll need this:
Alias /tshirtshop/ "C:/tshirtshop/"
<Directory "C:/tshirtshop">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
Now save the httpd.conf and restart Apache. Now put your files in C:\tshirtshop and go to http://localhost/tshirtshop/

You should now see the files you have just placed in C:\tshirtshop or your index file will load up automatically.

#5 yaqub

yaqub
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 29 October 2006 - 05:29 PM

Man thanks alot that worked. Now I can actually get rolling. I really appreciate it! ;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users