Instead of entering cumbersome changing IP addresses in your browsers, you can use "normal" domain names. This is especially useful when testing on multiple mobile devices. Accessing services in your internal company network, such as wikis, image databases, CRMs, etc.
Try the Course for Free Transcript Hello, everybody. Welcome to Web Applications for Everybody. So I'm going to download it here. And then on Windows, so it takes me straight to the download.
I'm just going to say I'll go ahead and run. I'm going to say yes. That's nice that they give us that checkbox. I don't exactly know. I've never used it.
So, I don't know. Accept license agreement. Put it in MAMP. Desktop icon. Let's go ahead and run it. So now we're going to continue.
Yeah, MAMP. We should also have this on our desktop. So it's coming up. So this is very important, you've got to allow this to happen because if you don't. Well, let's check them both so that MySQL can talk. And that's very, very important. And now that they're up and so we can open the Start page. And there we go, and you can take a look at PHP info. And then you can look at phpMyAdmin and literally at this point, if you got something coming up here in phpMyAdmin, you have successfully installed MAMP.
So congratulations. Now we're going to install Atom, the text editor. You literally could do any text editor. I use Atom because I like it. It works on Windows, Mac and Linux the same way. But literally, you can use any text editor that you like. Don't use Notepad or Word. Certainly don't use Word, because if you use Word, it'll mess your files up, okay?
We really need a text editor with syntax highlighting and things like that. So it's finished downloading and it's getting ready to install it. So we'll get that started. So let's open the start page, because there's a lot of good information we can get here.
You are in really good shape, everything is running fine. The database servers is running and php is running, so I'll get rid of this. So what we're going to do is we're going to write our first application, and so I'll have Atom here, and so I'm going to do file, new file.
And now what I'm going to do is I'm going to save this file. I've pinned it here to make my job a little easier. I found it once, drug it over here and pinned it. So I can get right here. Now, this is the web document root for your web server, and you can make folders here. So I'm going to make a new folder. I'm going to call this folder, first. Make that folder and I'm going to save this file call it as index.
Now, syntax highlighted this for us because it's showing this. Now, the way it works is I can go anywhere from local host on down, to the folder that I just made, to the file I just made, index. And so, we see that C: And so this is just an HTML page. We've seen it, we can view source. Now, so far, we haven't actually run any code on this PHP. So, let's go ahead and write some code.
So and show you how PHP can run code. And then a tag, that's? And I can run code in here. And I'm going to run this code. Run it again. And so there we go, says hi there. Let me put a space in here. So this is code and basically what happens, now let me put a paragraph tag in here. Put a paragraph tag some HTML, put an end paragraph. Something else. But then, in place of this, we get the string high there. So let me save that. And hit refresh again. And so this bit came from the executing code that ran here.
Is, now, the double quote was already there, sorry. So I'm going to save that. And now I'm going to hit refresh. So, looks like it didn't quite work. Well, I gotta concatenate this with a dot. No, this is supposed to be an x, that's why I made a mistake. File, Save. Refresh, okay.
So, you you see this came, Hi there. All this stuff came from the executing code. So you can think of all this output as the result of executing this code, and anything that is printed out during this code is put out as the webpage. And so, that's kind of the idea, you put files and folders inside of this htdocs, and then you execute them by running them in a browser. As a matter of fact, I make it an assignment I think it's so important. So we just finished writing our first web application.
Now, let's go ahead and make a syntax in this application. Make a syntax error and we're going to make all kinds of mistakes. So I'm missing a semicolon there. So I come up here and I refresh it. And what happens here is we get an error. Now, I just put the error in so you kind of know what the error was. But the question is, what if this was like hundreds of lines of code and you had to figure out what's going on.
So, let's take a look. There is a setting. It turns out that printing errors on the screen is great for developers, but it's really bad for production systems. And so they default these systems when they install them to not turning on, not showing errors. So we have to find out how to change the errors. So we're going to go to that start page, and then go to phpinfo. And we're going to look at the loaded configuration that's right here, C: You gotta remember this perfectly, 7.
So let's open that file. File, Open File.