First PHP Script: hello.php
Let's create a simple PHP script that outputs "Hello, World!" to your browser.
🔸 Steps:
- Open any text editor (e.g., VS Code, Notepad++, Sublime Text).
- Create a new file and save it as
hello.php. - Write the following PHP code:
<?php
echo "Hello, World!";
?>
🔸 Place the File:
Save hello.php inside your web root directory:
- XAMPP:
C:/xampp/htdocs/hello.php - WAMP:
C:/wamp/www/hello.php - LAMP:
/var/www/html/hello.php
🔸 Run in Browser:
Open your browser and visit:
http://localhost/hello.php
You should see the output:


