Raza Bayani

PHP Tutorials 2: Creating First PHP Project

PHP Tutorials 2: Creating First PHP Project

Inside the First PHP tutorial we taught you how to make a localhost or home server. In this tutorial when your local server or host is ready you need an editor in-order to write PHP scripts or codes there. Developers choose text editor by their own tact or manner. you can use window notepad for starting even, but We’ll suggest you the latest version of SublimeText3. For installing SublimeText3 you can go the website and choose the appropriate version, download and install it.

Writing the First PHP Script:

First you have to know that where PHP files must be saved. Your all PHP files need to be saved in the coming path: C:\wamp64\www. You can access your PHP files, codes or scripts by this folder otherwise your codes are not runnable. This means that www is a root folder for your local sever or host.

Better to make a new folder for every project inside the www in-order to make your project easily accessible. For creating first PHP project make a folder inside the www and name that “Hello”.

Create PHP project folder

Now open WampServer let it turn to green if it is not open and green already.  Then open SublimeText3, Type the following code inside that and save the codes inside the Hello folder in the www directory named as test.php. Path (C:\wamp64\www\Hello)

First PHP Code

Open your browser or and find your code’s result by: http://localhost/Hello/test.php

First PHP project result

So this is the first PHP script result that you have written. Keep in mind that put a semi-colon at the end of php codes, it shows that the code line is ended.

Congrats if your browser screen looks as above picture because you have successfully created first PHP script.

Some PHP Rules:

  • PHP files must be saved with .php format.
  • PHP scripts start with <?php and end with ?>, Server will think every code between these two tags as PHP code.
  • When you are with WampServer your PHP files must be saved in www folder that you have already done.

Keep Following These series of PHP tutorials to Learn PHP.

[button link=”http://codejow.com/php-tutorial-1-how-to-create-a-local-host/” size=”default” icon=”Select a Icon” side=”left” target=”blank” color=”3945b7″ textcolor=”ffffff”]Previous Tutorial[/button]

Raza Bayani
Raza Bayani

Raza Bayani studies BCE (Bachelor in Computer Engineering) in Poly-technical University of Kabul. He is the CEO of CODEJOW group, a web designer, coder and recently a blogger. Raza thinks, he can help others and also boost-up his own programming skills being on codejow.com.

Related Posts
%d bloggers like this: