Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP not working in XAMPP

Tags:

I have a problem running PHP in XAMPP 1.7.7 for windows. I've installed XAMPP in a local server with IIS (changed the port to 81 in httpd.conf as well as other configuration) so far it works and I could connect to the xampp/index.php but coulnd't run any .php files in my htdocs (shows blank except for the html part). It works in my local (also have an IIS installed) but couldn't make it work in a server.

Any help would be much appreciated.

like image 540
Loupi Avatar asked Feb 23 '12 02:02

Loupi


People also ask

Why my localhost is not working in XAMPP?

Resolve Apache port conflicts by changing your listening port to 8080. Include the listening port in the address when accessing localhost. Change your MySQL port to 3307 if another application is blocking the default port 3306.

How do I run a PHP file on localhost?

If you want to run it, open any web browser and enter “localhost/demo. php” and press enter. Your program will run.

Do I need to install PHP if I install XAMPP?

Why Do You Need XAMPP? To run PHP for the web, you will need to install a web server like Apache and a database like MySQL – and both are supported by XAMPP. XAMPP is a local server that can run smoothly on our personal computer, and is accepted in both Windows and Linux.


1 Answers

If I got your question correctly, I think I had the same problem accessing a php file in XAMPP. I have been online for several hours searching forums and Google for the answer, not until I found the simple solution.

I was accessing the PHP file as a file on c drive (eg. C:\xamp\htdocs\data.php or file:///c:/xamp/htdocs/data.php) instead of as a webpage (ie //localhost/data.php).

I hope this will be helpful to you as well.

like image 100
user28864 Avatar answered Sep 21 '22 18:09

user28864