Think Locally, Act Locally - Setting up a PHP Development Server

The first thing I needed to do was to set up a local testing environment, so that I can create a database on my very own hard drive, write PHP pages, and test them with a web server.
Turns out that there are 493 ways that this can be done, and a simple Google search reveals that each one has at least 19 tutorials on the Internet. You do the math, because at that point I decided to look for the simplest solution. The one I came up with is called WAMP Server, which is for Windows. That's what the W is for. Windows, Apache, MySQL, PHP. It has all of them bundled together, a bundle of joy.
So I installed that. The only real problem I had with it was this: it didn't work. So I went and bothered everybody on my favorite web development forums, and they told me that (in my case) Skype was taking the port that WAMP needed. I don't really know what a port on a computer is, but it's some kind of a door-like thing, an opening through which things pass. I had to change a setting in Skype before WAMP would work. The setting in Skype was under Options > Advanced > Connections - I had to un-check "Use port 80 and 443 as alternatives for incoming connections". Apparently this lets Skype choose any port it wants. So if WAMP is running, Skype will still get a port that makes it happy.
So, now I have a PHP development environment.
Next, I needed to set up Dreamweaver, which is my homeboy that I use for everything, and I don't care what all the haters say. That involved creating a Site Definition, which I've done 3,057 times before, so I'm not about to describe all the details. The important parts are the paths - the one under Local Info where you tell Dreamweaver physically where on your hard drive the files are, and then the two paths under the Testing Server tab.
Now, for some reason, I thought that the root of my new local web server was at c:/wamp/bin/apache/apache2.2.11/htdocs. But it's not. It's at c:/wamp/www.
So, I'm putting my site files at c:/wamp/www in a folder named after the site, northeastlooms*, in a subfolder called site. So the physical path to my site root is: c:/wamp/www/northeastlooms/site. That path is what goes in "Local Info/Local Root Folder" and also on the Testing Server tab in the Testing Server Folder field. Under URL Prefix goes http://localhost/northeastlooms/site/. If you look at those two different paths, you can see the relationship between them. http://localhost points to whatever is in the local server root - in my case, that's a folder called northeastlooms containing a folder called site, containing the files for my web site.
And I don't even have a web site yet. But there you have it, that's my PHP Development Environment.
This video tutorial by David Powers, Defining a PHP Site, was helpful and so was this article on Adobe.com: Setting up a PHP development environment for Dreamweaver.
* Names have been changed to protect the innocent.
Labels: MySQL, PHP, WAMP, web server

0 Comments:
Post a Comment
<< Home