php file trying to download

Allgemeines Forum zum Thema Apache Friends. Bei Problemen mit XAMPP bitte entweder das Linux- oder das Windows-Forum benutzen. Hier geht's wirklich nur ganz allgemein um Apache Friends.

php file trying to download

Postby Kelvin » 20. October 2010 04:24

I am new to PHP and am trying to set up Apache and PHP allong with MySQL on my laptop. Have set up Apache and the feather Icon appears in my tray and it tells me it is running. Have reconfigured my htdocs to be C:/htdocs rather than the long winded default. Have run the standard PHP test and the intro page renders. However when I save a file with a .php extention and try to open it in browser, :cry: rather than rendering the download sheild appears. Have checked and rechecked my Apache config and am stumped. As I say I am a novice at this so the answer is likekly to be obvious, but alas not to me.

Any assistance geatfully received.

Cheers Kelvin
Kelvin
 
Posts: 5
Joined: 20. October 2010 04:08

Re: php file trying to download

Postby Altrea » 20. October 2010 05:30

How do you try to open the php file in your browser?
Have you installed the XAMPP package or all components on your own?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: php file trying to download

Postby Kelvin » 20. October 2010 23:23

Hi Altrea. I installed them seperately. I was working from a book and that was how they told me to do it. It occured to me that there mast be an integrated solution as I was going through the config process. Do you think I should download XAMPP instead. I don't want to have to start again as the download time was so long and I am a bit stubborn anyway and don't like to admit defeat.

Cheers Kelvin.
Kelvin
 
Posts: 5
Joined: 20. October 2010 04:08

Re: php file trying to download

Postby Altrea » 21. October 2010 00:03

Kelvin wrote:Do you think I should download XAMPP instead.

Well, thats up to you. XAMPP is a package of the most common components you need to develop and test your scripts at home (or to start learning scripting php too of cause). This package is preconfigured and runs nearly out of the box.
Depends a bit on your operating system, but mainly installing is like: download => unzip => start (just follow the short installation guide).

But maybe that don't solve your problem. So i ask again:
How do you try to open the php file in your browser?
What does your browser address bar tell you?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: php file trying to download

Postby Kelvin » 21. October 2010 04:58

I opened the php file by clicking on it in windows explorer
Kelvin
 
Posts: 5
Joined: 20. October 2010 04:08

Re: php file trying to download

Postby Altrea » 21. October 2010 11:07

Okay, and here is the problem.
php must be requested with a webserver and parsed through a php parser, because it's a serverside programming language.

Your php-files must be saved in your Servers DocumentRoot or a subfolder of it. Which your DocumentRoot folder is is configured in your Webserver configuration file.
After that open your Browser and request the php file by URL.

for example: If your file is saved directly in your DocumentRoot path, the URL is http://localhost/file.php
If your file is into some subfolder of that its http://localhost/path/to/file.php
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: php file trying to download

Postby Kelvin » 29. October 2010 01:08

Thanks for that. Working now. Sorry for not responding sooner but have been of Sick.

Cheers
Kelvin
 
Posts: 5
Joined: 20. October 2010 04:08


Return to Apache Friends

Who is online

Users browsing this forum: No registered users and 43 guests