By rgfirefly on
ok I'm running WAMP with Apache 2.2.6, PHP 5.2.5, and mysql 5.0.45. Also I have drupal 6.0 installed into the www directory. I created a php page to do a basic echo, however when i try and open it with IE(or the index.php file) it wants to download. If i try and open it in FF it displays the echo command along with the text. I'm sure this has something to do with apache, but I'm not 100% sure. can anyone help me with this problem?
Comments
Assuming you've done
Assuming you've done everything else correctly, you may be missing the config to tell apache about php.
Check for the following in your httpd.conf :
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps .phtmls
If not there, add it in with the other AddType entries.
httpd.config file info
this is what is under the addtype section in my httpd.config file:
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php-source .phps .phtmls
when i try and go to my www folder and double click on the index.php or the firstpage.php files it opens them in IE and attempts to download still. I have also tried directing the browser to them using /localhost, 127.0.0.1, and c:\....
ohh this is also apparently keeping drupal from installing properly. I thought it had installed but apparently it still doesnt work.
Oops, didn't see you were
Oops, didn't see you were running a wamp install. I had suggested you go to lamphowto.com.
I would still suggest running through your install again, make sure php was installed correctly and is avaialable to apache, easiest check for that is to view your error_log when you restart apache. It should say if php is correctly configured to work with apache.
Just for people who haven't
Just for people who haven't solved this yet, my fix was commenting out the AddHandler line at the very top of the .htaccess file. Apparently, that messes with some Apache configurations.
localhost
You are accessing the php file as http://localhost/..., right? The behavior you described seems like you are opening it as a file (you know you are doing that if the url starts with file://...). To have the php code interpreted you have to get it through apache and that is why you have to use localhost.