Locked lesson.
About this lesson
Download and install Sublime Text, and create your development environment.
Exercise files
Download this lesson’s exercise file.
Sublime Text Editor Development Tool.docx57.4 KB
Quick reference
Setting up a Development Environment
In this lesson you'll download and install Sublime Text, and create your development environment.
When to use
Do this once when first setting up your development environment.
Instructions
Download the Sublime Text Editor and Xampp.
Hints & tips
- https://www.sublimetext.com/
- https://www.apachefriends.org/ for Xampp if you have not downloaded it in the previous lesson.
- 00:04 Okay, in this video I want to talk about setting up a development environment.
- 00:07 Now, for this course, I'm going to be using a tool called Cloud 9, c9, and
- 00:12 unfortunately Amazon bought this company a while back and has since shut it down.
- 00:17 You won't be able to follow along and use that exact tool, but like we talk about in
- 00:20 the last video, it doesn't really matter, you can run this in your computer.
- 00:24 So if you haven't already downloaded and installed XAMPP within the last video,
- 00:28 go ahead and do that.
- 00:29 You're also going to need this Sublime text editor, head over to sublimetext.com,
- 00:33 and you could just click this download button and download this anywhere.
- 00:37 I'm going to save it to my desktop, go ahead and
- 00:39 click this button right here as soon as it finishes downloading.
- 00:42 Now am not going to do that because I've already installed it on my computer, and
- 00:46 there's really nothing to show you, just follow along with the prompts,
- 00:49 click Next until it installs.
- 00:51 If it's a different version number by the time you watch this video, no big deal,
- 00:54 just download the latest one.
- 00:55 And like I mentioned, this is available for Windows, Mac, Linux,
- 00:59 any kind of computer you have.
- 01:01 The next thing you want to do is make sure anytime you want to run PHP code on your
- 01:05 computer, you need to make sure that XAMPP thing is running.
- 01:09 Head to your start menu, type in xampp and then this should pop up, and
- 01:13 then just always make sure to click this start Apache button, and
- 01:18 you see when it turns green you're good to go.
- 01:21 So, next, open up your Sublime text, just go to Windows Start Menu and search for
- 01:25 sublime text, click the icon when it pops up, and you should see a screen like this.
- 01:29 Now we need to create a folder directory to keep all the files we're going to make
- 01:33 throughout this course.
- 01:34 So, first off, I'm just going to create some real quick PHP here, and
- 01:39 we don't care what any of this says yet.
- 01:42 I'm just putting this on the screen, so we have something in this file.
- 01:47 Okay so now we want to save this file, come over here click File Save As, and
- 01:53 navigate to you C directory, and then find that directory where you installed XAMPP.
- 01:59 This file needs to go in that directory, in our case it's c/xampp,
- 02:04 and inside here look for the htdocs directory, right?
- 02:09 So now we want to right click anywhere in here, and create,
- 02:13 new folder, and I'm going to call this php-course.
- 02:17 There you go, and it really doesn't matter what you call this but,
- 02:20 this is a PHP course, so we call that.
- 02:23 Now double click this, and then inside here,
- 02:27 save this as index.php, right?
- 02:30 Okay, now we want to come over here to Sublime and click on Project and
- 02:35 add folder to project.
- 02:37 And the same deal we want to navigate to that C directory
- 02:42 the XAMPP folder, and then the htdocs folder.
- 02:46 And then find the directory we just created this php-course and
- 02:49 not don't double click it just single click it to highlight it.
- 02:52 Click Select Folder, and then you see boom, it pops up here.
- 02:55 Now in the future, if we want to add more files to this thing, we just right click
- 02:59 and create New File, it just pops up right here, and you're good to go.
- 03:03 This is almost exactly like what I'm going to be using with my Cloud 9
- 03:07 stuff throughout the course.
- 03:09 Except the only difference is, in Cloud 9 there's a terminal box down here
- 03:13 at the bottom.
- 03:13 And obviously, Sublime doesn't have that, but we're not going to really
- 03:17 be using any terminal commands, so we can just ignore that anyway.
- 03:20 Just to show you very quickly, this is the Cloud 9 development environment that I'll
- 03:24 be using throughout the course.
- 03:25 You can see it looks very similar to the Sublime Text Editor we just had open all
- 03:29 of our files are here on the left, of our code will be here on the right.
- 03:33 Just like in Sublime Text,
- 03:35 all of our files will be here on the left of our code will be on the right.
- 03:39 So, whenever I type in something here, whatever it happens to be,
- 03:43 you'll just type in the same thing here and your Sublime Text, and
- 03:47 you should be good to go.
- 03:49 So the only real difference if you look at this, and
- 03:52 we'll get into all this later, is this little terminal here at the bottom.
- 03:56 And this is where we run commands, we're not going to be really running any
- 04:00 commands except to save our code to Git, and Git Hub.
- 04:02 And we'll talk about that in the next few videos, but
- 04:05 I think in the next video I'll show you a little terminal that you can download.
- 04:09 And in fact this is it right here, this doesn't mean anything to you right now but
- 04:13 it will in the next video when we download and install it.
- 04:15 But this is the little terminal we're going to be using so,
- 04:18 if I ever type of a command down here in the terminal,
- 04:21 you'll type the exact same command on your terminal and you should be good to go.
- 04:25 So to run this file as we mentioned in the last video just pull up your web browser,
- 04:31 and go to local host and now we want to type in that directory we created.
- 04:36 So it's php-course, and since we named this file index.php,
- 04:41 it will pop up as the index file, you could also explicitly type in index.php,
- 04:48 and the same thing will pop up, that's cool.
- 04:52 So now anytime we create a new file, so for instance,
- 04:57 New File over here, Save As, let's just call this page2.php.
- 05:03 PHP files always end in .php, and here we can just copy this and
- 05:08 paste it, and then we could change this to Page2.
- 05:13 Very exciting, if we save this, now we could just head over to our web browser
- 05:19 and just run that by typing page2.php and boom, now we have page 2.
- 05:23 I'm going to go ahead and delete that, just right click and
- 05:28 Delete file, and we're good to go.
- 05:30 So those are really all the tools you need to run php on your computer, and
- 05:34 it's a pretty straightforward, and very, very cool.
- 05:37 So in the next video I'm going to talk a little bit about version control,
- 05:39 using something called Git, that's G-I-T, and that'll be in the next video.
Lesson notes are only available for subscribers.