PHP Hello World
Create a file named hello.php and save it in the root directory of your web server with following content.
PHP Hello World Example
Run Example ››
<?php echo 'Hello World';
Now, enter your web server's URL in your browser, ending with /hello.php. If you are using a web server installed on PC, the full URL might be http://localhost/hello.php or http://127.0.0.1/hello.php.
If you are using a host use the domain or sub-domain they have provided.
If everything configure correctly, you will see "Hello World" message in your browser. If you see that, you have just created your first PHP web page!
If you do not see any output, browser prompt for a download, or you see PHP file as text, then, either PHP is not enabled in your server or something went wrong on configuring. Read installation guide to learn more. If you are using a host, contact them to find a solution.