Create a file named hello.php and put it in your web server's root directory (DOCUMENT_ROOT) with the following content: Show Example #1 Our first PHP script: hello.php
'; ?> Use your browser to access the file with your web server's URL, ending with the PHP Test This program is extremely simple and you really did not need to use PHP to create a page like this. All it does is display: If you tried this example and it did not output anything, it prompted for download, or you see the whole file as text, chances are that the server you are on does not have PHP enabled, or is not configured properly. Ask your administrator to enable it for you using the Installation chapter of the manual. If you are developing locally, also read the installation chapter to make sure everything is configured properly. Make sure that you access the file via http with the server providing you the output. If you just call up the file from your file system, then it will not be parsed by PHP. If the problems persist anyway, do not hesitate to use one of the many » PHP support options. The point of the example is to show the special PHP tag format. In this example we used
|