Let's step into the pool and start to swim........
Make sure you are running apache server .
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.
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.
- 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.
- try 'localhost' (without quotes ) in your browser. If it shows a page then you are fine. Else there is something wrong with the installation.
- Ex : C:/wamp/www , C:/ xampp/htdocs
- Ex: /srv/www/public_html
<?php echo 'Hello World !' ?>
- '<?php ' is opening tag and '?>' is closing tab of php. Compiler will only look into the codes between these tags.
- 'echo' means print this .