Here are the steps you need to take to get a copy of a Drupal website onto your local computer for development purposes, using the XAMPP stack and a variety of tools. Many of the steps taken here have been made so that you can keep your PHP files outside the standard htdocs
DocumentRoot directory of the Apache server while maintaining whatever else you have running on your XAMPP installation. A mirror of this article is located here.
1) Install XAMPP software. This gets you Apache + MySQL all set up in a few clicks. Skip this step if you have both already set up (Drupal needs things like php and mod_rewrite in your Apache build.)
2) Download a copy of your production 'drupal' database to your local MySql server. I suggest using a program like Navicat MySQL since it handles UTF-8 data properly (unfortunately my favorite free MySQL client, SQLyog, seems to lack proper UTF-8 support).
3) Create a user on your local mysql database to match the remote connection settings and give them full permissions:
% mysql> GRANT ALL PRIVILEGES ON drupal.* TO 'drupaluser'@'localhost' IDENTIFIED BY 'drupalpassword' WITH GRANT OPTION; FLUSH PRIVILEGES;
4) Get a copy of the website's PHP files for your Drupal installation (In my case, use a source control system client like Perforce) and copy them to a location you want to do your work in. An example: C:/p4/atlas-drupal/drupal
. I will call this location %your_drupal_files%
from here out.
5) Edit %your_drupal_files%/sites/default/settings.php
and change the base URL to $base_url = 'http://localhost/drupal';
You should still be able to leave the $db_url
connection setting alone.
6) Edit %your_xampp_location%\apache\conf\extra\httpd-xampp.conf
and add the following lines according to where your copy of drupal lives on your computer:
Alias /drupal "%your_drupal_files%/"
<directory "%your_drupal_files%">
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</directory>
You'll need that "FileInfo
" directive if you are getting 500 errors in your Apache error log like "RewriteEngine not allowed here". You could also add these lines in standard httpd.conf
if you are not using XAMPP but just plain Apache.
7) (Skip this step if you are using regular Apache and not XAMPP)
Edit %your_xampp_location%\apache\conf\httpd.conf
and uncomment out the line LoadModule rewrite_module modules/mod_rewrite.so
You need this so Drupal can have "clean links".
8) Edit %your_drupal_files%/.htaccess
and change the RewriteBase
to /drupal
.
9) Restart the Apache service (with the XAMPP control panel if you are using XAMPP)
You now should be able to navigate to your sandbox development copy of the site via http://localhost/drupal
Comments
errr
Where in the handbook should this go?
urm....
Child page here: http://drupal.org/node/22282
for now. If we can get some more articles we can make a section for test sites.
I should probably update and transfer my stuff from here: http://www.blkmtn.org/book/drupal
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
done!
done!
http://drupal.org/node/75545
Feel free to add your book pages as child pages I guess?
is it compatible to test module?
I've installed drupal 5.x in wampserver not in xamp but the problem many modules such like cck, views do not run properly, it was gone error !! my question, does xamp server get same problem just like wampserver ?
Tweaks for URL rewriting to work with XAMPP
I found that when I put in the above mentioned line of " AllowOverride AuthConfig FileInfo" in
%your_xampp_location%\apache\conf\extra\httpd-xampp.conf
I get 500 errors. I removed it and put in "AllowOverride All" in its place like this:This combined with uncommenting and moving the
LoadModule rewrite_module modules/mod_rewrite.so
in http.conf will get drupal working in a custom directory with clean urls on XAMPP : Here is the node with more to help get URL rewriting to work with XAMPP. - http://drupal.org/node/43545
Jeffrey Dalton
Creative Director & Founding Partner
BKJ Digital
https://bkjdigital.com
The original doesn't work
The original doesn't work for me either, so I got it to work with
AllowOverride FileInfo Limit Options Indexes
on that line instead of All, as well.
(upon seeing http://devtime.blogspot.com/2008/02/htaccess-order-not-allowed-here.html )
XAMPP multisite config
I tried running multiple sites from a single codebase under xampp.
My tips:
1. It's also possible to add sites as subdomains of localhost. Configuration is similar. Advantage: it's easier to distinguish between the local and the remote site if they have the same name.
For this, the hosts file should contain definitions such as
2. I used the following apache virtual hosts configuration (in C:\program files\xampp\apache\conf\extra\httpd-vhosts.conf):
3. I tried to put files in different locations but got 500 errors. Instead, I used the Junction utility (http://drupal.org/node/31489) and created a symbolic link from C:\www to c:\program files\xampp\htdocs - much easier.
Amnon
-
Drupal Focused Search Engine | Drupal Israel
Personal: Hitech Dolphin: Regain Simple Joy :)
Hi. I see you just
Hi. I see you just successfully got a multi sites set-up working.
I have been trying to get one working for 24 hours now and still haven't succeeded. Could you please check out my post and see if you can point out where I'm going wrong?
http://drupal.org/node/111866
Great!
This is awesome to make tests and work on a website before uploading it.
--
Duplika | http://www.duplika.net
Simple Installation on a Server
I just wanted to clarify that the above instructions are for those wanting to set up a local test/development environment for Drupal, but not necessary if you are installing Drupal on a live server.
I just set up XAMPP on a Win2003 server, configured Apache for name-based virtual hosting by editing httpd-vhosts.conf and enabled the rewrite module in httpd.conf. I set up the virtual hosts under htdocs and everything worked smoothly.
I'm using subdomains of one of my domains to access the virtual hosts (site1.mydomain.com, site2.mydomain.com, etc.) and pointing them to the server's IP visible on the Internet.
Everything worked smoothly, no 500 errors or problems of any kind.
The instructions above, although quite useful, may confuse those wanting to do a fresh install of Drupal on a live server running XAMPP.
------
Con paciencia y calma,
sube un burro a una palma
Just making a note here for
Just making a note here for others,
I needed also
RewriteBase
uncommented in my .htaccess file before clean url's were working(I was getting 400 and 404 errors)
take a look at this thread > http://drupal.org/node/43545
GiorgosK
------
Web development/design blog part of the world experts network
------
GiorgosK
Web Development
Connection Keeps Timing Out
I tried the steps above but am having a problem. Things were going fine until I copied the .htaccess file from my server to my local computer. Then the C:/drupal directory became hidden. I don't know if this is the root of my problem. I have followed all the steps and re-checked several times to make sure that I applied the changes as indicated. When I try to go to http://localhost/drupal the browser attempts to load www.localhost.com and times out.
I am probably doing something simple wrong, but am not familiar with the inner workings of apache to readily identify where I went astray.
Any suggestions?
Steve Halleman
Great stuff! I set up drupal
Great stuff!
I set up drupal on XAMPP but I hadn't managed to get clean URLs.
We seem to have two similar pages on this topic though:
http://drupal.org/node/161975
http://drupal.org/node/75545
PLease Help ! - Newbie
Hi people,
thanks for submitting this article to assist people like myself.
I have downloaded and installed XAMPP, my root installation folder being D:\Develop\XAMPP.
MySQL, Apache and PHP are fully functional. I can browse and manipulate tables in my test schema using MySQL Visual Query Browser. If I enter localhost into my browser ( firefox ) I get a redirection form the index.php file so all 3 certainly working.
I copy my Drupal download into htdocs but when I enter localhost/drupal into firefox I get...
"Access Forbidden !
You don't have permission to access the requested object. It is either read-protected or not readable by the server. yada yada yada.
Error 403"
Tearing my hair out here trying to figure out what this might be and how to correct it. I don't have a lot of hair to begin with so any help appreciated getting what seems to be a fantastic framework up and running.
Thanks
Keith
Excellent!
Thanks so much for the helpful article. For everyone else's benefit I wanted to share some findings for anyone else who is about to get started with the process.
drupal.*
and later wondered why the user had no access to the database -- you need to give the actual name of your database here, of course!In summary I just want to thank the writers and commentators for all of your help. Although it took me 2 days to navigate through the issues with XAMPP and my backup database, ultimately I am pretty sure I could do this from start to finish in about an hour or two now that I've been through it once. Now I can focus on more useful matters like coding and performance tuning...
And speaking of performance tuning -- I am a relative newbie to PHP, Apache, MySQL and Drupal and I have been noticing that my site which is running on my shared hosting is quite slow, and had assumed it had something to do with demand for resources from other people using the hardware -- I was wrong! From running this application locally I can see now that the main bottleneck is the CPU (specifically the cycles taken by Apache httpd.exe). Not sure if the culprit is Apache, Zend/PHP or MySQL, but the CPU is running quite heavy in a Drupal site that has a decent bunch of plugins installed. The system memory and the browser memory and performance were all fine (using an old HP Pavilion with 256 MB RAM, 2 GB virtual RAM, and a single 2.3 GHz processor) but the CPU was running close to 100% during a simple query such as "show recent posts" on a site that actually only has a total of 10 nodes, or so. It was also running heavy attempting to display uploaded images. This actually shouldn't surprise me since the phpMyAdmin installation on my hosted web site had shown me that the SQL queries were not built well or running well. My guess is that this is just making the query processing code too intensive. But who knows...
Anyway, I hope my experiences will help guide you in figuring out how to navigate these tools.
DOES NOT WORK
Don't waste your time following this guide, you will screw up your configuration and it will not work. The instructions are unclear and assume too much knowledge for a guide.
I wasted about 2 weeks trying and failing to get drupal running on XAMPP using this guide. Even with the help of Drupal experts they couldn't get it functioning. It still doesn't work now, I'm never going near another guide like this. Might as well have spent my time scratching my a**e for all the good it did me!
...
You are angry over a two year old forum post?
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide