0

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>
4
  • 2
    Is your file extension .php or .html? Commented Jul 6, 2019 at 20:03
  • 2
    PHP does not run in a browser. Commented Jul 6, 2019 at 20:09
  • Do you mean it works on another browser then? Commented Jul 6, 2019 at 20:21
  • 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. Commented Jul 7, 2019 at 12:09

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.