Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php + apache when i try to access a php page it's asks me to download

Status
Not open for further replies.

touregg

Programmer
Nov 7, 2003
46
US
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.
 
Apache/PHP is not executing your scripts.

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





Want the best answers? Ask the best questions!

TANSTAAFL!!
 
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.





Want the best answers? Ask the best questions!

TANSTAAFL!!
 
i don't have any loadmodule lines in my http.conf and i can't find the libphp4.so file any where on my system. i will check again though
 
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top