I will call you back again to end of the lecture in PHP.
And in this video lecture we go ahead and learn how to write our very first PHP code.
All right.
So we're going to write our PHP code.
And that is the very first thing we're going to do.
Because in the previous lecture we are able to download and install atom on our systems.
And like I told you, if you have any other editor, go ahead and follow up immediately.
Every other thing is just the same.
All right.
So I actually got this atom.
In case you don't have any editor with you, you can go ahead and join me step by step and we'll get
to this point.
So once you install atom.
This is what we're going to have.
And now you can see that everything here is just a welcome message.
I will go ahead and close all these things.
So of course everything right in here.
What are we going to do now is first of all we're going to add a folder because it says we should add
a folder right in here.
Now let's go ahead and add a folder.
Remember we have not created any folder yet.
That means we have to create a folder.
And I'm going to show you where your folder will be created, because that is where PHP will actually
go to go and look for PHP files.
So go ahead and hit on add folder and go over to PC and go over to Local Disk.
Then move to users and they will click on this.
Select the name of your computer and uh open up this.
Then inside here you can be able to add a new folder right here.
I'm going to stretch this open.
And uh let's go ahead and add a new folder right in here.
So I'm going to go over to new and I'm going to add new.
Then the name of the folder I'm going to add I'm going to say w w w.
Now you can add any name of your own choice.
So I just created a folder called w that is the name of a project.
So I'll go ahead and hit on select for that.
So remember that you can do to change this name in case if you want you can go ahead and change this
name.
I just added WW w as my own favorite.
Okay, so it's nothing more to do that now you have been able to create this.
What you need to do is go ahead and right click and create a file right in here I'm going to create
a new file.
And I'm going to call that file name to be any name you want.
Let me go ahead and say site dot PHP.
All right.
So this is site dot PHP.
Go ahead and hit on enter.
And I have sites dot PHP and go over to this folder.
You can see I have the PHP file right in here called phi dot PHP.
All right.
So I have never to create a folder.
And I've been able to create a file.
And this PHP file I just created is exactly the same thing with HTML5.
Remember that our HTML is Hypertext Markup Language and PHP is hypertext preprocessor language.
All right.
Now whatever you are going to do is ensure that you have little knowledge or full knowledge, little
or full.
But you would not going to learn PHP if you don't have knowledge of HTML at all.
So if you don't have knowledge of HTML, our advice will check out our HTML courses on our site and
kick off immediately so you can be able to get the fundamental knowledge of what HTML is all about.
But if you have little knowledge or a pro in HTML, you go ahead and kick off immediately.
So PHP is actually just the same thing.
And we're going to use HTML files right in here.
Now we have been able to create sites dot php.
I'll go ahead and add a word means.
What I'm saying is that I just created a HTML skeleton.
That is where we're going to write our PHP code.
So this HTML skeleton will help us to be able to write PHP code and execute our programs.
Now you have this, uh, stub right in here.
You're going to write your PHP code inside the body of this HTML skeleton.
So whatever you're going to write in PHP is going to be right inside the body.
And let's go ahead and write a simple PHP, uh, code.
And then we execute that and see how that works, because that will enable us to be able to understand
whatever we are doing.
So to write a PHP code, you're going to write a tag, open up a tag and uh, name that to be PHP.
And then you go ahead and close that tag as well.
So go ahead and close that tag.
And, uh, once your tag is closed, that means PHP will run inside here.
So anything you write inside here is your PHP code.
And a simple PHP code is going to write is going to be equal.
Anytime you use the word equal, it means you want to voice out.
That means PHP is about to voice out.
Sunday is going to be able to read whatever it is written after this equal.
So this guy had a right simple hello world.
And once you write that, you close that with a semicolon at the end and you have written your very
first PHP code, what means remains now is to execute this code.
Now go ahead and save your file.
Anytime you write, ensure that you save your file.
Now if you go ahead and run this because this is not dot HTML, it's not going to run that way.
You have to first of all create a server.
Then open up your command prompt and open up a server.
We're going to create a server, but it's going to help us to run this.
And for you to create a server here, what we need to do is you're going to write PHP.
Your command prompt.
And then you're going to put this in the use opaque keys S then call lookup.
Then lookup hosts.
Now once you've added a lookup rules have to add a colon for Tarzan.
Then go ahead and hit enter.
And hit enter.
It will say what is the September 11th PHP 8.3. 11 development server lookup was started.
Now you can see that we have our server right in here.
We have started this.
The development server has actually started and is listening at this point.
HTML blah blah blah.
Lukaku is 4000 copies, so I just copied that and uh, I was able to copy this.
Now I want to start the server again because I have this year I don't want to close this.
Anytime you're working on this, don't ever close this command prompt.
So I'm going to repeat this again.
PHP.
S local host colon 4000.
So I have to start it again.
So at the point of running your PHP code, ensure that your command prompt is always open.
You can actually go ahead and minimize this right.
Then go back to your browser and go ahead and pass all that which you just copy it.
And once I paste that I'll go ahead and hit enter.
And now I hit enter.
I see not found.
The request test source was not found on this server.
So the server we just created is actually having nothing.
And remember that we created this.
So we created a folder right in here.
So that folder is under the user our users.
And the default name is W-w-w.
Now what I want to do is because that is your PHP, we always go, you go ahead and put a backward slash
and then go ahead and say w w w.
So this actually open up some things I've done before.
And backward slash site dot p h p.
So go ahead and remove all this.
And if I go ahead and click on this right now you can see I have Hello world.
All right you guys when I was typing I was actually getting what I've done previously.
And that is actually not a problem.
And we go ahead and uh, media ran with these.
So we've been able to create our server, and our server is currently running around at the moment.
And then we have this folder we created and the file name is uh site dot PHP.
I hope that is cool.
So this is the code we actually used.
We are able to echo out Hello World and we created a folder, a server using our command prompt.
And that server is actually running.
And we are able to get this.
So that is really cool and very interesting.
So I hope that is cool.
Put on this practice with this and show you you run your very first PHP code, and then we move deep
into the course and enjoy the PHP.
We just started right now.
So there are lots of things to learn in this course and just get started and practice whatever we do.
And if you have any question, use the question and answer section and I'm going to get back to you
as soon as possible.
Thank you so much.
And I'm going to see you in the next video lecture.