i just setup apache and php, and when i load a html file from my webserver it works fine, but when i goto a php file it asks me to download the file instead of displaying the page.
On what platform are you running Apache and PHP?
What version of Apache are you running and how did you install it?
What version of PHP are you running and how did you install it?
Assuming that you are running PHP as an Apache module, the following are required in httpd.conf:
1. A line to load the module:
LoadModule php4_module path/tolibphp4.so
The PHP install process probably did this for you.
2. Relate the MIME-type of the PHP scripts with filesystem extensions:
AddType application/x-httpd-php .php .phtml
Sorry i should have added that in the first place.
os:Fedora core 2
php and apache were both the lastest stable versions
4.3.6 i belvie for php and apache was 2.0.x
my http.conf does not have the loadmodule line. can i use that exact line that you have typed? or do i have to change it for what i have
also i copied the php.ini file into the /usr/local/lib folder, i was told this was correct.
You'll have to change the LoadModule line to match where Apache is looking for module library files. Look at your other LoadModule lines -- if libphp4.so is in the same filesystem directory as the other module files, match those paths.
On Fedora, I believe that PHP expects php.ini to be in /etc, but don't bet on that. Once we get PHP up and running, you'll be able to run a script which is comprise of:
<?php
phpinfo()
?>
there is a line in the output of that function that will tell you where PHP expects php.ini to be.
to be honest i don't really know why it didnt' work before, but i deleted everything and reinstalled it and now it works. go figure. i must have typed something wrong in one of the configures. I bought one of those books from barnes and nobel that tells you how to do this and it was using apache 1.3 and php 3 i think. i was using apache 2.0 and php4. so i used the install notes from the php website. i don't remeber doing anything different though. but it works now. Thank you for your help!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.