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)
It should be:
<?php
phpinfo();
?>
Your current code seems like a malformed HTML comment.
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(); ?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.