PHP not working in XAMPP

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.

Leave a Comment