Pergunta

sudo apt-get install apache2

sudo apt-get install php5

sudo apt-get install libapache2-mod-php5

sudo /etc/init.d/apache2 restart

I have done and created a test page test.php but the browser doesn't show any information

test.php content

<!--?php
phpinfo();
?-->

But the apache alone works (the browser loads the http://localhost/ just fine)

Foi útil?

Solução

It should be:

<?php
  phpinfo();
?>

Your current code seems like a malformed HTML comment.

Outras dicas

Well, PHP open and close tags are <?php and ?>. Instead of php tags, you have a html comment (<!-- and -->). Your test.php should look like this:

<?php phpinfo(); ?>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top