Jump to content

PHP File keeps trying to download


walleymo

Recommended Posts

Hi everyone. I'm new here. I've been programming for about 5 years, but I'm new to PHP.

I just got PHP, Apache, and MySQL installed and I'm reading a book learning these technologies. I'm loving it so far.

My problem is, whenever I have an HTML document calling a php file, the browser (Firefox 2) tries to open or download the file instead of executing it. The code executes fine if it's all in one file [i]and[/i] the file extension is .html. Is there a problem with my configuration or something?

Forgive me if this question has been asked a lot before.

Thanks,
Jon
Link to comment
https://forums.phpfreaks.com/topic/27557-php-file-keeps-trying-to-download/
Share on other sites

It sounds as though you've missed a step somewhere in the configuration.  :)  Have you checked the [url=http://www.php.net/manual/en/faq.installation.php]PHP installation FAQ[/url] and closely followed the manual's instructions for your OS, e.g. editing you apache config file and php.ini?
Yes, it's the configuration.  Apache decides what type a file is (usually based on the extension, but can also be based on location and other factors).  So Apache needs to be told to execute .php files using php.

I can't give details because I don't know them, sorry :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.