Page 1 of 1

Can't open PHP file, error message.

PostPosted: 23. November 2008 05:20
by billbeee
Hi All,
I have installed xampp on my FC8 system.
I can access the control panel http://localhost/xampp/index.php OK.
Everything seems to be working fine. The demo scrips work fine.

I have a couple of test scripts in my /opt/lampp/lampp/htdocs/test-docs/
folder where I have permissions.

When I open one of my .html files in a browser, no problems, but when I try to open one of my .php files I get and error message from Firefox.

"You have chosen to open
info.php
which is a: php script
What should Firefox do with this file?..............etc.

I have searched long and hard for the answer, and I am sure to be missing something obvious, but can anyone help?

Cheers
Bill

Re: Can't open PHP file, error message.

PostPosted: 23. November 2008 17:11
by glitzi85
billbeee wrote:I have a couple of test scripts in my /opt/lampp/lampp/htdocs/test-docs/

How did you install XAMPP?

glitzi

PostPosted: 23. November 2008 22:31
by billbeee
Hi Glitzi, Thanks for looking.

I installed it following instructions here,

http://www.apachefriends.org/en/xampp-linux.html

I copied XAMPP Linux 1.6.8a

* Step 2: Installation
After downloading simply type in the following commands:

1. Go to a Linux shell and login as the system administrator root:

su

2. Extract the downloaded archive file to /opt:

tar xvfz xampp-linux-1.6.8a.tar.gz -C /opt

I started it OK, the orange and yellow http://localhost/xampp/index.php
comes up and I can access all the menu items.

When I try to open up say the /opt/lampp/htdocs/xampp/phpinfo.php directly in my browser I get the same error message. This is the same file script that I can read easily through the http://localhost/xampp/index.php index page.

Surely I don't have to set up something like this? How do I see the results of a simple script like <?phpinfo();?> in a file called "info.php" ?

Cheers
Bill

PostPosted: 23. November 2008 23:04
by Wiedmann
When I try to open up say the /opt/lampp/htdocs/xampp/phpinfo.php directly in my browser

You can't open PHP files directly from the filesystem in your browser.

This is the same file script that I can read easily through the http://localhost/xampp/index.php index page.

Because the PHP part in such files is parsed from the webserver and not from your browser, you must use this way.

PostPosted: 24. November 2008 20:34
by billbeee
Thanks Wiedman,
Such a basic concept and I missed it, I am happy now and looking forward to the learning.
Cheers
Bill.