Lynn
Lynn

Reputation: 83

Why is Firefox displaying HTML, but ignoring my PHP code

This basic html shows the paragraph tags in Firefox, but will not execute the php code. I'm running Apache XAMPP 2.4.39 on a Fedora laptop.

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>

<p>My first paragraph, 7/5.</p>
<?php phpinfo(); ?>
</body>
</html>

Upvotes: 0

Views: 125

Answers (1)

bart
bart

Reputation: 1048

You can run php -v from command line to verify if PHP is installed and running correctly.

Check if your file has a .php extension.

Be sure you are accessing the file from a webserver using a URL like http://localhost/example.php and not via local file://localhost/www/example.php.

Upvotes: 1

Related Questions