Page 1 of 1

problem after xampp installation

Posted: Fri May 22, 2009 7:02 am
by hnissani
After installation, all seems OK.
Komodo editor tells me my php installation is OK.

When I try to run a simple php file, I get the "file download" dialog which asks LOAD, SAVE, CANCEL.
Any suggestion?

Re: problem after xampp installation

Posted: Fri May 22, 2009 11:12 am
by Christopher
Does is server HTML files, but not PHP files? If so check that the PHP is associated with .php files in the Apache conf.

Re: problem after xampp installation

Posted: Fri May 22, 2009 11:33 am
by hnissani
Yes, I have the assocoation as follows -
in httpd.conf I have the lines:
AddType application/x-httpd-php .php .phtml .html
AddType application/x-httpd-php-source .phps

An interesting fact is that when I put the http://localhost URL in my browser, I get the
"Welcome to XAMPP for Windows Version 1.7.1 !" page.

When I click phpinfo() field, I get the php info table.
The problem occurs only while I run ( or call from browser) a test (or any other) php file.

Re: problem after xampp installation

Posted: Fri May 22, 2009 11:47 am
by Christopher
Are your scripts using short tags? You should use the <?php ?> tags.

Also, you should not server .html files as PHP scripts (as specified in the AddType line).

Re: problem after xampp installation

Posted: Fri May 22, 2009 4:50 pm
by hnissani
Thanks Arborint

Yes I use full tags.
I removed the .html but it did not help.

Re: problem after xampp installation

Posted: Sat May 23, 2009 3:34 am
by hnissani
Thanks all kind souls.

The problem was solved when I understood that:
1. The file has to reside in the htdocs folder.

2. The way to invoke a php file is via a URL in the browser, like this:

http://localhost/MyFileName.php

whereas I was invoking it by clicking its name.

THE PROBLEM IS SOLVED. :offtopic: