-2

I have recently installed Apache, MySQL and PHP, but the page is not loading the PHP code, it's interpreted as HTML comment. All services are enabled but haven't got a clue what's going on. Obviously is not possible to reproduce my localhost environment.

I am on Linux Mint 20 and latest Apache/MySQL/PHP.

Does anyone know how to make PHP work?

enter image description here

enter image description here

Kelson Batista
  • 406
  • 4
  • 25
  • Does this answer your question? [How to enable PHP short tags?](https://stackoverflow.com/questions/2185320/how-to-enable-php-short-tags) – user3783243 Mar 06 '22 at 02:36

1 Answers1

4

Your PHP tags are the short ones. In order to enable them, you need to change short_open_tag=On in php.ini, or just write <?php instead of <?.


///BONUS : the short tag '<?=' can be used without editing the php.ini. It's shorter than:
<?php echo $var; ?>

<?= $var; ?>
Manuel Guzman
  • 483
  • 5
  • 15