0

Im having some problems running php files on my localhost. When I run them in the browser all I can see is the php code, Im just trying to establish a connection to MySql database. I have installed XAMPP.

For example:

<?php

$user = 'root';
$pass = '';
$db = 'letsdeal';

$dbConn = new mysqli('localhost', $user, $pass, $db) or die("Cant connect");

echo "Yes";

?>

When I run it all I see is the php code, somebody knows why?

Thanks in advance!

Oliver
  • 3
  • 1

2 Answers2

0

you have a problem with webserver or php installation.

You can try to restart XAMP and in a bad case you must reinstall it.

Bye

0

If you're seeing raw PHP code it may be that you're just accessing it using the wrong uri which is taking you to the raw file, not the parsed code.

Community
  • 1
  • 1
gfish3000
  • 1,557
  • 1
  • 11
  • 22