Let's step into the pool and start to swim........
- First you need to install apache 2 server and PHP in your operating system . There are many executable files that can install this in your workstation.
- Make sure you are running apache server .
- try 'localhost' (without quotes ) in your browser. If it shows a page then you are fine. Else there is something wrong with the installation.
- Make sure you have a text editor. For windows I would suggest Notepad++ .
- Go into the servers public_html folder. For Wamp/linux systems this can be www folder.
- Ex : C:/wamp/www , C:/ xampp/htdocs
- Ex: /srv/www/public_html
- Open a new file in the servers default folder you just found in step 4 , and save it as hello_world.php.
- Type the following text into it.
- And go to your browser and type' localhost/hello_world.php '. And this will show Hello World in the browser.
<?php echo 'Hello World !' ?>
Explanation:
- '<?php ' is opening tag and '?>' is closing tab of php. Compiler will only look into the codes between these tags.
- 'echo' means print this .
the easy book to learn PHP
ReplyDeleteClick To Download