Explore Yourself !!!


How to start PHP
October 7, 2008, 8:18 am
Filed under: LAMP | Tags: , , ,

Before start php you need some back understanding of web technology. How web sites are developed?

Web site consist of three parts. We need to understand clearly what these are and how it works. First of all you need a server called web server. Apache is a server of linux where you actually put your files. Secondly you need to choose a scripting language. Without any scripting language you site can’t be dynamic. We choose PHP as web language. Finally to handle operations of data you need a database. Mysql is best suited with PHP and Apache.

LAMP: Stands for Linux, Apache, Mysql and PHP. So we can easily understands that, PHP is best suited in Linux server and this is the reason why everybody chooce Linux server for hosting. In contrast, most of we are using windows. Moreover, configure LAMP is not so easy for everyone. So what’s the solution? There are a number of integrated tools which are simple to install and configure automatically. XAMP is a very good one. WAMP is another one. You can download both for free from the web. Download XAMP/WAMP anyone  you like and compatible with your OS. Once XAMP/WAMP download and installed you are ready for to code with PHP, MySql and Apache.

For instance lets download and install XAMP. Then goto c://xamp/htdocs/ this is called root/document root. Lets create our first project named practice

create a folder c://xamp/htdocs/practice named practice.
now create a file named hello_world.php inside practice folder. i.e c://xamp/htdocs/practice/hello_world.php
Web consist of HTML/XHTML , Scripting language(PHP, C# dot net, JSP, Cold Fusio etc), Javascript and Database.
PHP code must contain a beginning and ending tag.
Short tag: <? …… ?>
Full tag: <?php …… ?>
Paste following code into hello_world.php file
<?php
echo “hello world”;
?>
How to run your script/site? Open a new browser window(Mozilla firefox or Internet explorer or Google Chrome) and paste the following url into your address bar.
where practice = project name
hello_world.php = file name.

No Comments Yet so far
Leave a comment



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>