problem after xampp installation

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
hnissani
Forum Newbie
Posts: 5
Joined: Fri May 22, 2009 6:49 am

problem after xampp installation

Post 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?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: problem after xampp installation

Post 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.
(#10850)
hnissani
Forum Newbie
Posts: 5
Joined: Fri May 22, 2009 6:49 am

Re: problem after xampp installation

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: problem after xampp installation

Post 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).
(#10850)
hnissani
Forum Newbie
Posts: 5
Joined: Fri May 22, 2009 6:49 am

Re: problem after xampp installation

Post by hnissani »

Thanks Arborint

Yes I use full tags.
I removed the .html but it did not help.
hnissani
Forum Newbie
Posts: 5
Joined: Fri May 22, 2009 6:49 am

Re: problem after xampp installation

Post 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:
Post Reply