tags:

views:

14

answers:

2

I've looked around for hours trying to get this to work. I'm not new to programming in general but I've never done anything with servers and PHP. I can't get Firefox to open any *.php pages in my root directory (c:/wamp/www). It tells me Foo is a PHP script, and gives me 2 options: open it with ... or save file.

To start I downloaded and installed WAMP.

I can access MYSQL fine and run phpinfo() through my localhost which generates the webpage.

I can also load phpMyAdmin fine.

Since phpinfo is loading the page I have no idea what's wrong here.

My httpd.conf file for Apache has all the right entries already according to sites I've visited:

LoadModule php5_module "c:/wamp/bin/php/php5.3.0/php5apache2_2.dll"

AddType application/x-httpd-php .php

AddType application/x-httpd-php .php3

PHPIniDir "c:/wamp/bin/php/php5.3.0"

Looking through the WAMP console and going through the Apache Modules I can see that the php 5 module is indeed checked on. So the Apache server knows the PHP exists, knows where to find it, has it loaded but can't load any php files from my root directory. How do I solve this?

+2  A: 

You must access the documents via http://localhost/, because only then the server will receive the requests.

If you use c:\wamp\www, the browser doesn't make any request and just opens the file on your disk.

Mewp
Sorry I should clarify more. I wasn't typing it via Firefox, I have the files in the directory and I was just double clicking them. But I did type this into the Firefox address bar:http://localhost/"filename" and it worked. I had no idea I wasn't supposed to dbl click the files. Thanks alot ^_^
SDevil
@SDevil, please mark this as the answer.
Geoffrey Van Wyk
+1  A: 

what address are you typing into the address bar of firefox?

c:/wamp/www ?

or

http://localhost/ ?

You might want to use the second one.

harkman