localhost/test.php returns nothing
39,693
You said that you put your script in /var/www/html
So the link might be
localhost/html/test.php
Also check the error log file for PHP error.
# cat /var/log/apache2/error.log
EDIT: Change your quote, ” are for Word document and not programming ;-)
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line</p>
<?php
echo "This is a PHP line";
phpinfo();
?>
</body>
</html>
Comments
-
mOna over 3 years
I am following a tutorial "PHP & MySQL for dummies" to build a web application. I created a simple
test.php
file in web space (/var/www/html
). The problem is that when I typelocalhost/test.php
in the browser address window, it returns me an empty page. I triedlocalhost/php.info
and it worked well but I could not find whytest.php
does not work.This is the test.php code:
<html> <head> <title>PHP Test</title> </head> <body> <p>This is an HTML line <p> <?php echo “This is a PHP line”; phpinfo(); ?> </body></html>
I do appreciate any information.
Thanks.