0
votes

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>
1
Is your file extension .php or .html?Quinten
PHP does not run in a browser.Honk der Hase
Do you mean it works on another browser then?Andreas
He means it's a server-side language. Neither Firefox nor any other browser need to know about PHP, let alone execute it. This must be a configuration issue or a misuse within Xampp.Álvaro González

1 Answers

1
votes

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.