2

First things first, when I open and run XAMPP this shows up

enter image description here

The issue is, when I try and open a .php file it doesn't work it simply just shows the code WITHIN the php file, the php itself does not work.

I have downloaded and uninstalled XAMPP 3 times today.

Any ideas?

  • 1
    Those lines in red mean that Apache isn't the webserver. You have another webserver running. – Barmar Oct 04 '14 at 00:45
  • or maybe you use skype , and if you launch it before apache the port are already used , so you have to launch apache before skype , or change skype configuration . – Juck Oct 04 '14 at 03:10

4 Answers4

1

This is a rookie mistake, Make sure the URL says localhost/index.php and not file:///C:/...

1

To fix the problem you need to change xampp port from 80. Normaly 81 works just fine. Follow these steps to change the XAMPP server port number:

1) Stop the XAMPP server, if it is running already.

2) Open the file [XAMPP Installation Folder]/apache/conf/httpd.conf.

3) Search for: "Listen 80"

4) Change to (Example): "Listen 81"

5) Search : ServerName (Update this too)

6) Save

7) Restart XAMPP server and you are done.

Note: Now your url is: www.localhost:81

c0utinh0
  • 179
  • 1
  • 8
0

You should just try reinstalling the operating system as well as xampp over again. My answer takes into consideration that you have already tried installing xampp three times. If you have a Mac just restart holding the command and r keys and then wait for the recovery center to come up. Then select reinstall osx. This requires internet. If you have windows there might be an install disk that came with the system and try reinstalling from the disk.

www139
  • 4,960
  • 3
  • 31
  • 56
0

Problem is that port 80 is being used by some other application. If you have installed skype it would skype. We can manually change the port used by skype for that check the answer for this SO question How to solve WAMP and Skype conflict on Windows 7?

You can also make sure which appication is using port 80 by checking this SO question How to find which program is using port 80 in Windows?

Community
  • 1
  • 1
Johny
  • 2,128
  • 3
  • 20
  • 33
  • Haha! it was because i was accessing the PHP from my computer via C drive and NOT from the server via localhost - Rookie Mistake – user3791691 Oct 04 '14 at 22:07