0% found this document useful (0 votes)
30 views

PHP Installation and Writing Hello Word Program

This document discusses how to install PHP and WampServer on a Windows system and create a basic 'Hello World' PHP script. It explains downloading and installing WampServer, configuring the local server settings, creating a PHP file in the www directory, and viewing the script output in a web browser.

Uploaded by

www.mukkarram321
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

PHP Installation and Writing Hello Word Program

This document discusses how to install PHP and WampServer on a Windows system and create a basic 'Hello World' PHP script. It explains downloading and installing WampServer, configuring the local server settings, creating a PHP file in the www directory, and viewing the script output in a web browser.

Uploaded by

www.mukkarram321
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

PHP Installation and Writing Hello Word Program

This PHP tutorial we will learn PHP installation process step by step, and after installation learn
how to create PHP script file and how to run or execute Php script file on server.
Download WampServer Here: Download WampServer link

Note: No need to reinstall WampServer if you already installed WampServer


After successfully downloading WampServer install setup run as administrator.
After Successfully Installed WampServer open WampServer as like below:

All Programs — >> WampServer –>> Start WampServer


After starting the WampServer show the WampServer icon on taskbar near to clock icon at right
bottom of windows screen.
Below menu you can Start All Services and Stop All Services of WampServer.
There is a topmost option “Localhost”, which shows the server configuration.

Now Click on “Localhost” you have below screen for server configuration. Version configuration
PHP version and Apache Server Version configuration which we have already installed on our
computer system.
Creating Php File
Here, the “www directory” option define the path where we can save the PHP file.
The default location path is “C:\wamp\www“.
We must save all PHP page at in “www” folder.

When we click on “www directory” option on above menu it will locate directly to www folder
in C drive. where we have to save all PHP file.

PHP WampServer by default create a file index.php in www folder. Where we run the index file
on browser it look like: http://localhost/index.php
PHP Hello World on the web browser
Write the following code in the file index.php:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PHP - Hello, World!</title>
</head>
<body>
<h1><?php echo 'Hello, World!'; ?></h1>
</body>
</html>

The code in the index.php file looks like a regular HTML document except the part <?php and
?>

The code between the opening tag <?php and closing tag ?> is PHP:

<?php echo 'Hello, World!'; ?>

This PHP code prints out the Hello, World message inside the h1 tag using the echo statement:

When PHP executes the index.php file, it evaluates the code and returns the Hello,
World! message.

Launch a web browser and open the URL:

http://localhost/index.php

If you see the following on the web browser, then you’ve successfully executed the first PHP
script:

You might also like