This is your step-by-step guide to setting up a WordPress web development environment on a PC using XAMPP, WordPress 3.x, and Subversion.
XAMPP installs PHP, MySQL, and Apache on your PC turning it into a local web server for development purposes. Once installed you can begin creating custom WordPress themes and plugins in your own local development environment.
After downloading and installing WordPress on your machine and beginning to work on your custom code you may want to back up your work remotely. Also, it is not uncommon to have developers spread around the country and/or world working on the same project, so whether you are backing up your brain child or collaborating with others, Subversion (in conjunction with TortoiseSVN) is an excellent solution.
Let’s get started:
- Download and install XAMPP on your PC
- Download XAMPP
- Follow the installation instructions from the XAMPP site
- Start Apache as a service at the end of the install
- Visit http://localhost/ to see your new server in action
Open and modify your Apache config fileUpdate: XAMPP is now pre-configured with this optionC:\xampp\apache\conf\httpd.confEnable mod_rewrite in Apache
Open and modify your PHP config fileUpdate: XAMPP is now pre-configured with these optionsC:\xampp\php\php.iniEnable gd_lib, simpleXML, and mysqli
- Open and modify your Windows HOSTS file
- Modify your Windows hosts file by adding your development domains using notepad
- File path on Windows XP & Vista: C:\windows\system32\drivers\etc\hosts
- Add this line to your hosts file, replacing “[domain]” with the name of your development domain (IP and Domian separated by a tab):
127.0.0.2 dev.[domain].com
- Open and modify your XAMPP vhosts file
- Add your development domains to your httpd-vhosts.conf file
- C:\xampp\apache\conf\extra\httpd-vhosts.conf
- Add these lines to your vhosts file, replacing “[domain]” with the name of your development domain:
<VirtualHost 127.0.0.2:80>
ServerAdmin me@localhost.com
DocumentRoot C:\xampp\htdocs\[domain].com
ServerName [domain].com
ServerAlias dev.[domain].com
</VirtualHost>
- Restart Apache by opening your XAMPP Control Panel C:\xampp\xampp-control.exe
- Create a new database for your development website and add a username and password for your WordPress project
- Download and install WordPress
- http://wordpress.org/download/
- Create a directory for the new WordPress development site at C:\xampp\htdocs\[domain].com, replacing “[domain]” with the name of your development domain
- Unzip and move the files contained within the “wordpress” subfolder to your newly created folder at C:\xampp\htdocs\[domain].com
- Modify your WordPress config file C:\xampp\htdocs\[domain].com\wp-config.php to include your database credentials and follow additional setup instructions contained within the wp-config file
- Visit your newly created site http://dev.[domain].com/, replacing “[domain]” with the name of your development domain
- Follow WordPress’ step-by-step installation instructions
- Start customizing WordPress
- Create a theme folder for the custom theme you will be creating in this directory C:\xampp\htdocs\[domain].com\wp-content\themes\my-theme-name
- Create a plugin folder for the custom plugin you will to be creating C:\xampp\htdocs\[domain].com\wp-content\plugins\my-plugin-name
- Use Subversion as a code repository and version control tool for your custom WordPress projects
- Find a host for your Subversion code repository, in this case we will be referring to the subversion service offered by Dreamhost at http://www.dreamhost.com/
- Start a new code repository for each theme or plugin you create through the Subversion tab on the Dreamhost panel
- Download and configure TortoiseSVN to easily manage your Subversion environment from your PC
- Upload your code project to your newly created code repository online using these instructions
- You will soon become familiar with terms like: Checkout, Commit, Update, and Merge
- Share your repository and credentials with other developers working on your project
Before installing WordPress, We need a mini-server installed in our computer like WAMP. One can easily installed and st-up WordPress for business or personal use, no need of special knowledge for that.