Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 23, 2008 05:44PM

I have successfully installed WAMP, but I can't seem to access files in the www folder. I can access [localhost]. But when I try to access [localhost], I get a 404 page not found error message. For that matter, when I try to access anything below [localhost], I get the 404 message.

Do I need to configure apache or php beyond the initial installation?

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 23, 2008 05:58PM

Okay, I need to update my post above:

I can access any directory EXCEPT [localhost]. Is this a reserved directory name or something?

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 23, 2008 06:02PM

Hmm, there's something going on with the way my posts are being displayed...

I am having trouble accessing "localhost/projectName/htdocs" , but I can access any other directory under localhost.

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: November 23, 2008 06:49PM

does c:/wamp/www/projectName/htdocs exists?

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

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 23, 2008 11:29PM

Yes, it exists. I get a 404 error when I try to access the directory link provided by localhost/projectName. Other folders are accessed without error.

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: November 23, 2008 11:37PM

wat is the project? it may use a .htaccess to deny access

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

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 29, 2008 06:20PM

Yes, the folder does contain an .htaccess file. I suppose I need to delete that file to get WAMP to work correctly. I'll report back if there are any further issues. Thanks for the help!

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: November 29, 2008 06:33PM

well its there to keep it secure... but it must be set up wrong. paste up contents of file if u want

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

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 29, 2008 06:54PM

Here's the contents of my .htaccess file (I added the bracketing < marks here for clarity):

<
Options -Indexes

AddHandler Extension_Type .html .htm .php3 .php4
Action Extension_Type /cgi-bin/php.dat
# Customized Error Handler
ErrorDocument 204 /error.htm?e=204
ErrorDocument 301 /error.htm?e=301
ErrorDocument 302 /error.htm?e=302
ErrorDocument 400 /error.htm?e=400
ErrorDocument 401 /error.htm?e=401
ErrorDocument 403 /error.htm?e=403
ErrorDocument 404 /error.htm?e=404
ErrorDocument 500 /error.htm?e=500
ErrorDocument 501 /error.htm?e=501
ErrorDocument 502 /error.htm?e=502
ErrorDocument 503 /error.htm?e=503
<

BTW, is there a good resource on how to configure the .htaccess file?

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: November 29, 2008 09:00PM

u probably need to jsut add .php to

AddHandler Extension_Type .html .htm .php3 .php4

so it wud be

AddHandler Extension_Type .html .htm .php3 .php4 .php











apache has probably th ebest information >>[httpd.apache.org]

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

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 29, 2008 09:45PM

I added .php to the .htaccess file as you advised, but I still get error 404! I then changed the name of the .htaccess file to "a.htaccess" and I CAN access the htdocs folder, but my php scripts don't work.

The site had been working fine on a remote server at Network Solutions, so I figure there's some configuration issue with the way WAMP handles the .htaccess file. Any further suggestions?

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: November 29, 2008 09:47PM

well it has to be called ".htaccess"


ErrorDocument 204 /error.htm?e=204
ErrorDocument 301 /error.htm?e=301
ErrorDocument 302 /error.htm?e=302
ErrorDocument 400 /error.htm?e=400
ErrorDocument 401 /error.htm?e=401
ErrorDocument 403 /error.htm?e=403
ErrorDocument 404 /error.htm?e=404
ErrorDocument 500 /error.htm?e=500
ErrorDocument 501 /error.htm?e=501
ErrorDocument 502 /error.htm?e=502
ErrorDocument 503 /error.htm?e=503

all of this is just for custom error pages.. i presume u dont have a error.htm ?

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

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 29, 2008 10:10PM

Yes, I omitted the .htaccess file just to help troubleshoot whether that file was causing the error in opening the htdocs folder. I understand that to work, it must be called ".htaccess"

Yes, I do have an error.htm file in htdocs. My htm files require a php file located in a cgi-bin folder in order to produce my navigation buttons. If I omit the .htaccess file, my htm pages can be accessed, but the navigation links are not there, meaning that the required php file is not being accessed. If I include the .htaccess file, then I can't open the htdocs folder at all.

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: November 29, 2008 10:17PM

where is ur htdocs folder? this folder doesntl usualy exist or the cgi bin.. i know on production servers theses are in the public folder so possibly u need to replicate this layout exactly to that or the production server . is ur cgi bin in ur www folder?

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

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 29, 2008 10:26PM

Reading Apache's directive info, maybe the issue is with the .htaccess line:

Action Extension_Type /cgi-bin/php.dat

If the cgi-bin folder's URL is in the same directory as htdocs, shouldn't the directive read:

Action Extension_Type ../cgi-bin/php.dat, so that apache knows to look one level up for the cgi-bin folder?

Dster

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 29, 2008 10:34PM

The directory map is:

wamp -> www -> projectName -> htdocs, cgi-bin

index.htm (and all the other htm files/folders) and some php scripts are located in the htdocs directory. Certain php scripts that I want to remain inaccessible by users are located in the cgi-bin folder.

In this way, the htdocs folder is my root directory, and the cgi-bin folder is "outside" htdocs. This is the way Network Solutions has it set up. They direct all www.website.com requests to my htdocs folder.

I would like to keep this path the same, since my scripts all refer to those paths. I don't want to have to change all the scripts to move from authoring to production.

Dster

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 30, 2008 10:13PM

Okay, I figure the htaccess file is simply too complicated at this point-- besides, it works okay on my production server, and all I want to do here is develop locally, so I deleted the htaccess file.

I am now having a problem getting embedded php code to be read. Php scripts run only when they are called directly via localhost/projectName/htdocs/something.php, but do not run if the php code is within an html page such as:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[www.w3.org];
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Php Test</title>
</head>

<?php
print "Hello World!";
?>


<body>
</body>
</html>

Is there a configuration issue that needs to be addressed to get php code within an html page to work?

Dster

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: November 30, 2008 10:19PM

the standard procedure is to name the file .php this will be parsed by php engine

if you want html files to parse throught the engine then u need to add it in the apache config. (this is not recommend so much tho because it will slow down pages that dont have php in them)

open C:\wamp\bin\apache\apache2.2.8\conf\httpd.conf

find


AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

and add

AddType application/x-httpd-php .html

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

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: dster (---.hsd1.pa.comcast.net)
Date: November 30, 2008 10:26PM

Thank you very much! This will help speed up my website! Thanks again!

Dster

Options: ReplyQuote
Re: Newbie needs help configuring WAMP
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: November 30, 2008 10:38PM

no problem ur welcome

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.