Here's why and how to set up a local testbed server
I'm still learning ways to do things better, and I'm always open to new ideas for improvement, but this development work flow seems to work for me the best:
-
Code, Locally
The optimal configuration for web site development is to run a web server on the same computer you're using for development. I know a lot of people will disagree with this. Why?
-
"Too much hassle"
-
"There's no point, just code it on a remote server"
There are REALLY good solutions to this, namely XAMPP and MAMP. These projects are pre-configured for a web server running Apache, MySQL, PHP, Perl, Python, and more. The program can be run in Windows or MacOS environments.
The main problem with this is trying to work when internet access is unavailable. Also, most people don't have direct access to change the remote server configuration. That can be a problem if the ISP doesn't provide remote debugging.
Why is coding on a local server better?
-
You don't have to be connected to the net
-
Expand your horizons
-
Debugging
This speaks for itself. I want to be able to develop websites no matter where I am. No way to do that without developing on my local PC.
You call yourself a web developer, but you only know HTML and CSS? By setting up XAMPP, you'll get a better feel for important applications that help make the web possible: Apache, PHP, MySQL. It'll also give you a better idea of what your code is doing on the server end, ultimately making you a better developer.
You can set up debugging on a remote server, but if you can do that remotely, it's just as easy to do it on your local machine. That way you can debug while you're on an airplane.
-
-
Test/Debug Locally
-
Upload
-
Repeat
So you've got XAMPP set up on your desk/laptop and you're really to start coding. Have you ever tried coding in an IDE? In some cases, the difference can be night and day. I learned to code in C# and the Visual Studio IDE was irreplacible in helping me learn the language syntax and speeding up Windows app development in general. Right after that, a friend and I coded ~20,000 lines of PHP for a website in a simple text editor (EditPad). The difference was night and day. I still use EditPad for quick changes, but my current IDE of choice is Netbeans 6.5. It has integrated support for XDebug, making it infinitely easier to find bugs in (my friend's part of) the code. It can also help in learning how PHP works.
For instance, set a breakpoint and step thru some code, watching which variables are held in memory. I discovered all kinds of stuff allowing me to write nice code I wouldn't have known to do otherwise. If you are a level 10 guru in PHP then you can probably execute a script in your head. This is for the rest of us.
I keep a mirrored copy of whatever website I'm working on on my local hard drive. I make some changes, like adding an image popup. I test it and debug it locally, and when it's all working I ...
.. to commit changes. I usually do this at an off-peak time. Sometimes slight differences in server configuration can cause a working script on a local server to go bonkers on the remote server. For instance, a server I was developing a website on had PHP magic quotes enabled, while my XAMPP installation did not.
Once you get a new feature committed and it seems to be working good for everyone, keep coding and keep learning!
Resources:
- PHP (WordPress) development using Eclipse and XAMPP - GreatWebGuy
- Using XAMPP for Local WordPress Theme Development
- Installing Ruby on Rails (ROR) with XAMPP | Peri.me
- PHP (WordPress) development using Eclipse and XAMPP - GreatWebGuy
- Set up a Windows test server using XAMPP | drupal.org
- Installing and configuring PHP, Apache, and MySQL for PHP development in Windows
- A Complete LAMP Development Environment - Xampp, Eclipse PDT and XDebug - Tech Memorandum
- XAMPP + xdebug - SWiK
- Xdebug General List: [xdebug-general] Re: FAQ | Xdebug and XAMPP
- Malibu Garage: Local workstation xampp/Eclipse PDT/xdebug on WinXP from start to end
- Getting Xdebug to work with Apache/XAMPP to debug PHP » unitstep.net
- Install xDebug in XAMPP | Mad Babble & Lucid Thought
- Installing Xdebug on xampp for linux « The Indexer
- Using XAMPP for Local WordPress Theme Development
Keep up the good work!