I have php, apache, mysql etc...
I am trying to view a page named "index.php", which has
<php echo "hello world"; ?>
in it,
but instead I see a dialog box prompting me to open or save the file which is a PHP (application/x-httpd-php) file..
How can I make it render correctly?
I a CentOS 5.5
I'm on rackspace cloud servers BTW
If you installed PHP via package (like
yum -y install php
), then you should have an/etc/httpd/conf.d/php.conf
that specifies the needed entries. If apache was running when you installed php, then you have to restart apache for it to pick up the configuration changes.If you installed from source, you need to make sure the following directives are included in your httpd.conf (or an include)
The AddType and AddHandler directives are specifically needed to tell apache how to send files that end w/ .php. Otherwise, it will send with a default MimeType, which your browser will then prompt you to download as you are seeing.
I found the problem, I didn't select php as a language in the Plesk panel. I did that and it simply solved the problem. Thanks Alex for your suggestions.