You are on page 1of 23

Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.

ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Want to Write for Us?Read This | LoginBecome a Member

CHURCH MAG
Web
Analytics
Blogging
Books
Gaming
Internet Church
Interviews
Marketing
Open Source
Podcasting
RSS
SEO & Search
Strategy
Youtube
Desktop
Creative
Writing
Architecture
Experiences
Tutorials
Audio
Music
Art
Dance
Freelancing
Design
IT

1 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Management
Security
Servers
Wireless
Hosting
Computers
OS
Policy
Project Management
Code
CSS
HTML
PHP
Rails
JavaScript
Plugins
Tools
Mobile
iPad
Bible
SMS
Kindle
Opera
Playstation
Blackberry
XOOM
Palm
CMS
WordPress
ChCMS
Small
Medium

2 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Large
Tier 1
Tier 2
Tier 3
Tier 4
Tier 5
Podcast

Code 17

3 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Configuring Dropbox, Apache, PHP, and MySQL For a


Development Environment
Posted By Tom on January 24, 2011

This is Part 5 of The Beginner’s Guide To Setting Up a Development Environment.

By now, we’ve covered the major components of a development environment and have even begun to setup our own local development
environment.

Whenever I setup a new environment, there are always a few tweaks that I like to make to ensure that I’ve got the most flexible, easy-to-
manage environment possible for web-based work.

Though the following tips are completely optional, I’ve had a lot of success in this particular setup.

1. Setup Dropbox
Earlier in this series, we talked about managing our files and file history with Dropbox. If you followed through with that particular step,
then you can skip to the next section.

If not, we basically setup a directory out of which we would be doing all of our development work. This is valuable as it gives us
cloud-based storage and simple file version history.

So if you’ve not already done this, create a directory within your Dropbox out of which you can manage your projects. It’s best to keep the
directory a single word as spaces can cause issues in more advanced development:

4 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Done.

2. Re-configure Apache
At this point, we need to modify some Apache configuration files. Before doing this, make sure that you’ve disabled all of the applications

5 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

in the XAMPP Control Panel and that you’ve got your favorite text editor ready.

Follow the following instructions closely – typos can result in a malfunctioning environment.

First, we need to tell Apache that we’re going to be hosting our projects out of our Dropbox directory. Locate the Apache configuration
file. It should be in xamppapacheconf and the filename is httpd.conf.

At this point, make a copy of that file exactly as it is and rename is to something such as httpd.conf.orig. We need to back it up, just in
case.

6 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

httpd.conf includes all of the configuration options for the Apache web server including the path out of which we host our files. We need
to change that, so open it up in your text editor and look for the line containing DocumentRoot.

Yours should look something like this:

7 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

# DocumentRoot: The directory out of which you will serve your


# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/xampp/htdocs"

We want to update that last line. Rather than specifying the default path, we need to point it to our Dropbox directory. For example, if
your directory is called Projects and is located within Dropbox, then yours will read something like:

DocumentRoot "C:/Users/Tom/Dropbox/Projects"

Next, locate the lines that look like this:

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "C:/xampp/htdocs">

And update that particular line to contain the same path as you specified above. For example, mine looks like this:

<Directory "C:/Users/Tom/Dropbox/Projects">

Save the file, restart Apache, and navigate to http://localhost. Permitting that you specified everything correctly, your screen should now
display the contents of your Projects directory:

8 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

3. Minor PHP Configuration


You can open a PHP tag in two ways: <?php and <?. The latter is a convenience method but often causes trouble and broken functionality
in hosting environments as a lot of web hosts don’t turn on that option.

Since we want our development environment to be as closely related to a hosting environment as possible, we should do the same.

So locate your PHP configuration file. It should be found in /xampp/php. Look for php.ini.

9 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Open the file and locate the line that contains:

short_open_tag = On

And update it to read:

short_open_tag = Off

Save the file and restart Apache. Permitting everything went well, Apache should restart with no problem.

3. Install SQLBuddy
As you get more involved with web development, you’re likely going to begin creating and querying databases much more often.

PHPMyAdmin ships with XAMPP and its a powerful utility, but I prefer the simplicity of SQLBuddy. With our current setup, it’s a piece
of cake to install.

Download the application from the SQLBuddy website


Extract the contents to your Dropbox Project directory (yes, the same one in which we’re saving our projects)
This should create a directory called sqlbuddy unless you named it something different

Once done, navigation to http://localhost/sqlbuddy. You should be presented with the login screen:

10 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

The username is already specified and there is no password so you should be able to login with the information that’s provided (remember
that MySQL must be activated in the XAMPP Control Panel!):

11 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Done and done. That’s enough database management for now.

4. Miscellaneous Tips and Terminology


Finally, I wanted to cover a few points and terms that can often trip up new developers when it comes to running their projects.

Don’t install your database in Dropbox. Some want to throw their entire application into Dropbox. For performance and technical
reasons, don’t do that. Yes, this means that you’ll have to mirror the database on any other synced machine but it’s worth it.

12 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Local Environment refers to the machine on which you do your development. It’s your sandbox. It’s where it’s okay for things to go
wrong.

Testing or Staging is the environment, usually hosted on a separate machine, that mirrors the hosting environment in which your site
and/or application is going to run. This is where you simulate the public launch of your project and testit out. If something goes
wrong here, that’s okay.

Production is the live site. This is where you’re launching the project and where no testing or breaking should occur. Testing should
not occur here.

Hopefully that helps explain some of the language and reasons that we have for doing the things that we do.

In the next post, we’ll talk about configuring several editors to work with our development environment.

You may also like -

The Beginner's PHP The Right Way How-To Install The Complete Guide A Look at The 8BIT
Guide To Setting Up MAMP for Local To Writing a Development Shop
a Development WebDev WordPress Widget
Environment

About Tom: I write both code and content for this team and I love every minute of it.

All Posts by Tom

13 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Advertise Here

Advertise Here

14 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Advertise Here

17 Responses to “Configuring Dropbox,


Apache, PHP, and MySQL For a Development
Environment”
1.
Advertise Here

Aaron Fenwick
January 27, 2011 at #

Hey Tom… I’m having some trouble editing the httpd.conf file. I’m a Mac user and for the DocumentRoot path I have
“Users/AaronFenwick/Dropbox/Projects”. When I go to startup Apache, this error displays: “Syntax error on line 178 of
/Applications/XAMPP/xamppfiles/etc/httpd.conf:
DocumentRoot must be a directory”. Any ideas on why this might be occuring? Thanks!

15 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Reply

Tom McFarlin
January 27, 2011 at #

Try this (with the leading slash):


/Users/AaronFenwick/Dropbox/Projects

Reply

Aaron Fenwick
January 27, 2011 at #

Thanks! I thought that might be it, will I was bored in Chemistry today.

Reply

Aaron Fenwick
January 27, 2011 at #

*while* I was bored…

Reply

16 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Tom McFarlin
January 27, 2011 at #

That’s awesome. Been there, done that .

Reply
2.

Joshua Kahn
June 12, 2012 at #

Hey Tom,

nice clear tutorials, glad I found you, thank you internet.

I’m on a mac. Working on changing the httpd.config file to my dropbox project. I’m getting a 403 error…

“Access forbidden!

You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.”

I’ve read elsewhere that Mac’s are a little funny about accessing the applications folder. What’s weird is that with the default pointers
in the config file, it works fine.

Any thoughts?

Reply

17 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Tom McFarlin
June 12, 2012 at #

I’ve not experienced this issue on my Mac, but I use MAMP. From there, just click on the ‘Hosts’ tab, click on ‘General’ and
then in the ‘Disk Location’ point it to your Dropbox projects directory.

Reply

Joshua Kahn
June 13, 2012 at #

Well, lucky for me I work with some devs, one of whom was generous enough to help me figure this out.

Turned out the the permissions on Dropbox weren’t set up to allow XAMPP to access it.

Double cool is he showed me how to use the command line in terminal to identify the permissions issue and fix it. Not
sure I could reproduce it exactly, but I’m going to try and write it up.

Reply

Tom McFarlin
June 13, 2012 at #

18 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Sweet – feel free to contribute a tutorial for this site if you want! Would help others out .

Reply

Eric Dye
June 14, 2012 at #

Indeed! We’re always looking for awesome stuff like this!

http://churchm.ag/contribute

Reply

Joshua Kahn
June 14, 2012 at #

Okey doke, I’ll give it a shot. I’ll submit via that link once it’s done. It’ll be a few days probably.

Reply

Eric Dye
June 15, 2012 at #

19 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Reply

Rhys Owen
March 17, 2013 at #

You need to ensure the Dropbox folder is accessible. Try chmod 775 Dropbox – worked a treat for me!

Reply
3.

Dave
June 20, 2012 at #

Thank you so much for this; it’s going to save me a ton of hassle switching between machines!

Reply
4.

Julian
July 17, 2012 at #

Excellent! This is exactly what I was looking for. Now I have my Dropbox environment enabled

Reply

20 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Eric Dye
July 18, 2012 at #

Sweet!

Reply

Trackbacks/Pingbacks:
1. How To Setup a WordPress Development Environment | ChurchCode - March 12, 2011

[...] read:Using Dropox To Manage Project FilesInstalling a Web Server, Database, PHP, and Related ToolsConfiguring Dropbox,
Apache, PHP, and MySQL For a Development EnvironmentAs such, this guide also assumes that you have a Project directory located
in your Dropbox and that [...]

Get a Gravatar

Leave a Reply

Name (required)

Email (required)

21 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

URL

Help us fight spam. Check the box before submitting your comment.

Notify me of followup comments via e-mail

About Us:
We've been insanely-interested in exploring how the Church, ministries, and non-profits use technology to effectively fulfill their mission
to the world.

With a small blog that started in September of 2008 we grew faster than we had ever dared to dream expanding into a network of blogs
that reached more than a quarter million people every single month.

In May of 2011 we re-focused our efforts bringing all of the content back into one solidified brand - a "digital magazine" of resources that
still serve the same industries and that still has the same curious heartbeat that started this movement.

Join us - there is still much to be explored.

22 of 23 6/4/2013 9:54 AM
Configuring Dropbox, Apache, PHP, and MySQL For a Development Environment | ChurchMag http://churchm.ag/configuring-dropbox-apache-php-and-mysql-for-a-development-environment/

Blogroll
Advertise on ChurchMag
Archives
Contribute, Guest Post
Disclosure Policy
Job Board
Sitemap
Sponsor a Post

Copyright 2013 · ChurchMag

23 of 23 6/4/2013 9:54 AM

You might also like