PHP: Your first PHP-enabled page

Your first PHP-enabled page

<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo '<p>Hello World</p>'; ?> 
 </body>
</html>
  1. Create a file named hello.php and put it in your web server's root directory (DOCUMENT_ROOT).
  2. Use your browser to access the file with your web server's URL, ending with the /hello.php file reference. When developing locally this URL will be something like http://localhost/hello.php or http://127.0.0.1/hello.php but this depends on the web server's configuration.

Related concepts

Your first PHP-enabled page

PHP: Your first PHP-enabled page — Structure map

Clickable & Draggable!

PHP: Your first PHP-enabled page — Related pages: