English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have installed Apache and Configured it using PHP's installer. But when I try to open a File with .php extension Firefox displays it like a Normal text file. What to do?

2007-03-17 22:58:28 · 3 answers · asked by Anonymous in Computers & Internet Programming & Design

3 answers

Hello,

It seems you did not configure Apache to use PHP correctly. Maybe you have not stated the extension to parse so it treats it as a normal text file (happened to before)

To add the type of PHP to your apache, it is as follows for PHP5 version:

AddType application/x-httpd-php .php

Now all file extensions with .php will use the x-httpd-php instead of normal raw textural format.

Good Luck

2007-03-18 03:22:09 · answer #1 · answered by ? 6 · 0 0

For php to work you have to let the server run it.
Just directly opening the file will only show the contents.

The server has to "parse" the file to show the results. SO put your php file in the http directory for Apache. Launch your browser and in the address line go to http://localhost/yourphp.php
the server will parse the file and show the output.

2007-03-18 11:46:24 · answer #2 · answered by Tracy L 7 · 0 0

I don't know if you have already configured apache for php. Actually you have to let apache know some tools when he has to run a php code. You should find it in the apache help or you can try www.apache.org

2007-03-18 06:10:58 · answer #3 · answered by outlaw 2 · 0 1

fedest.com, questions and answers