yaqub Posted October 28, 2006 Share Posted October 28, 2006 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.phpCan 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 Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted October 28, 2006 Share Posted October 28, 2006 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 [url=http://www.phpfreaks.com/forums/index.php/topic,108327.msg435982.html#msg435982]this post[/url]. Quote Link to comment Share on other sites More sharing options...
yaqub Posted October 29, 2006 Author Share Posted October 29, 2006 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). Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted October 29, 2006 Share Posted October 29, 2006 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:[code]Alias /tshirtshop/ "C:/tshirtshop/"<Directory "C:/tshirtshop"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all</Directory>[/code]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. Quote Link to comment Share on other sites More sharing options...
yaqub Posted October 29, 2006 Author Share Posted October 29, 2006 Man thanks alot that worked. Now I can actually get rolling. I really appreciate it! ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.