Training

Our next U.S. stop:

Mike Anello and Andrew Riley from Mediacurrent are teaming up to offer the first Blue Collar Git workshop on Friday, June 8 as part of DrupalCamp Charlotte (also part of the Southeast LinuxFest). The cost is only $149 for the full day if you register during the month of May ($199 otherwise). 

New Podcast

Posted Wednesday, May 9 at 7:50 am
Brandon Morrison (Brandonian on drupal.org) joins Andrew Riley and Mike Anello on the first post-DrupalCon Denver edition of the podcast to talk about all things Geo in Drupal 7. Brandon is one of the maintainers of the GeoField module and is an active member of the Drupal Geo community.
Download Podcast 82
DrupalEasy_ep82_20120509.mp3
Syndicate content

Newsletter

Stay up-to-date on DrupalEasy workshops and other events. On average, we send about one newsletter per month.

Testimonial

Mike is a great teacher!

Who are we?

DrupalEasy is the collective expertise of Ryan Price and Michael Anello, who joined forces to provide training and consulting services worldwide. Read all about them and what they can do.

What is Drupal?

Drupal is a free, super-powerful content management system for sites that require information posting and collection, including blogs, forums, videos, photos, and databases of information. We think it is the best platform available. Here's why...

Why Drupal?

More and more savvy organizations are going with Drupal for content management, and its no mystery why. It’s free, flexible, and easy to maintain for small or large volume sites. Learn more...

Keep Local Database and Filesystem Settings in a Site-specific settings.php

A common development practice is to keep a local web server running on your laptop, or a development/staging server. A feature of Drupal designed for multisite installations can actually help you out in this situation.

Different servers often mean different databases, database users, and passwords. Sometimes, you may also need to point to a different files/ directory or tmp/ directory, especially if you are moving between Windows to Linux, or a local machine to a server.

In this case, you need to make a separate directory inside ./sites/, usually ./sites/localhost/ - then make a copy of settings.php from the default/ folder and place it in this new folder.

Change your database username and password as usual (see INSTALL.txt if you're lost), but also take a look at the $conf settings at the bottom of settings.php - this is where some of the magic can happen. Any setting stored in a variable - which is how most modules (especially core modules) store settings - is available to modify inside the $conf array.

Example: changing the files path and the temp directory:
$conf = array(
'file_directory_path' => 'sites/default/files',
'file_directory_temp' => '/tmp',
);

Now there's no need to visit Sites > Settings > File System on each site when you move databases around, just modify this file on each new server.

Also, think about setting cache settings here:
$conf = array(
'cache' => FALSE, //page cache
'block_cache' => FALSE, //block cache
'preprocess_css' => FALSE, //optimize css
'preprocess_js' => FALSE, //optimize javascript
);

The above settings will turn off all cache settings.

You can set lots more in this file. See this related DrupalEasy quicktip for more info.

Trackback URL for this post:

http://drupaleasy.com/trackback/197
No votes yet

More Quicktips


No comments

Pingback

[...] you are showing PHP errors on the screen, if this is an option. This is the kind of thing you can edit in your site-specific settings.php file, by [...]

Syndicate content