php causes repeated downloads on Mac

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

php causes repeated downloads on Mac

Postby tedherr » 25. January 2017 06:46

I am new to php. I start my servers in XAMPP. My html files load and run in the browser correctly, but my php files create repeated downloads until I quit from the browser.

I am using XAMPP 5.6.15-1 running on a Mac OS X version 10.10.5

Here's the php code:

<html>
<head>
<title>Simple XAMPP Test</title>
</head>
<body>
<p>Simple XAMPP Test: This is line 1</p>
<?php
echo "This is line 2.";
?>
</body>
</html>
tedherr
 
Posts: 3
Joined: 25. January 2017 06:01
XAMPP version: 5.6.15-1
Operating System: Mac OS X version 10.10.5

Re: php causes repeated downloads on Mac

Postby Nobbie » 25. January 2017 11:42

tedherr wrote:but my php files create repeated downloads until I quit from the browser.


What does that mean??

Some questions:

a) what is the name of your PHP script?

b) where did you store the PHP script? Please apply the full pathname.

c) what do you enter into your browser in order to load your PHP script?

d) what happens, if you only enter http://localhost into your browser?
Nobbie
 
Posts: 9689
Joined: 09. March 2008 13:04

Re: php causes repeated downloads on Mac

Postby tedherr » 25. January 2017 20:53

Excellent questions! Here's my responses...

What "repeated downloads" means is that the file loads end creates repeated downloads of itself that appear in the Downloads folder. I have to quit Firefox to stop the repetition. Your questions prompted me to experiment some more...
Firefox: Repeated downloads as described
Safari: Displays the php code
Chrome: Displays the php code

Answers to the other questions:
a) The name of the php script is test2.php
b) The file is stored in: Mac SSD/Applications/XAMPP/xamppfiles/htdocs/xampp/
c) I use this address in the browser: file:///Applications/XAMPP/xamppfiles/htdocs/xampp/test2.php
d) If I enter http://localhost the browser redirects to localhost/dashboard/ and brings up the Apache Friends "Welcome to XAMPP for OX X 5.6.15" page.

Thank you!
tedherr
 
Posts: 3
Joined: 25. January 2017 06:01
XAMPP version: 5.6.15-1
Operating System: Mac OS X version 10.10.5

Re: php causes repeated downloads on Mac

Postby Nobbie » 25. January 2017 22:30

tedherr wrote:b) The file is stored in: Mac SSD/Applications/XAMPP/xamppfiles/htdocs/xampp/
c) I use this address in the browser: file:///Applications/XAMPP/xamppfiles/htdocs/xampp/test2.php


Both of that is horribly wrong. Did you ever enter file:// instead of http:// for any online server? (No, of course not).

a) do NOT store your file to /Applications/XAMPP/xamppfiles/htdocs/xampp/, instead store it to /Applications/XAMPP/xamppfiles/htdocs/

b) do NOT use that horrible wrong address, instead enter http://localhost/test2.php (you may simply click on that link for testing).

... and finally get a tutorial about the meaning of Apache, of HTTP Protocoll, of localhost etc., you urgently need it.
Nobbie
 
Posts: 9689
Joined: 09. March 2008 13:04

Re: php causes repeated downloads on Mac

Postby tedherr » 26. January 2017 08:20

Thank you for your suggestions. As you already know, your suggestion works.

Thank you for investing your time to help me get started.

Ted
tedherr
 
Posts: 3
Joined: 25. January 2017 06:01
XAMPP version: 5.6.15-1
Operating System: Mac OS X version 10.10.5


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 6 guests