Drupalist

Tip

Don't leave behind .htaccess

When copying the files of a Drupal install, do not forget to copy Drupal's .htaccess file. If you've had the vexing problem where a site you've just manipulated has clean URLs turned on but they suddenly don't work, this may well be the reason. It took me fixing this problem many times before I realized what was going on.

Scenario

You make a directory for a new site, cd to the new directory, and use drush to download Drupal.

% mkdir mynewsite
% cd mynewsite
% drush dl drupal

The Importance of Preserving Context in Web Development

This morning, when I got down to the particular work task at hand for Imbee, I switched to Eclipse and found it stopped at a breakpoint I had set when debugging a certain crucial issue in my local copy of imbee.com. This was exactly my context from last night.

Getting phpinfo() output from any Drupal site

Seeing the output of phpinfo() is as easy as going to URL /admin/reports/status/php (e.g. http://www.example.com/admin/reports/status/php) on any Drupal site, when logged in to administer the site. This is quicker than writing a one-line PHP program yourself to call this function as suggested in a previous post on finding, changing, and verifying changes to your PHP initialization file.

Unsticking Yourself as a Drupal Developer: Googling & Getting Feedback

Intro

This post is being written for a presentation at the Western Massachusetts Drupal Camp on Jan. 22, 2011. It aims to share tips on getting yourself out of specific problems everyone encounters working as a developer with Drupal sites. Your presenter, Steve Cronen-Townsend a.k.a. crotown, was a Drupal freelancer for almost two years, and a few weeks ago joined Imbee as a full-time software engineer developing their Drupal-based web site.

Changing PHP's configuration file, php.ini

[This post is about making changes in PHP's configuration files when you have full command-line access to the underlying Ubuntu 10 server. The commands should be identical for other Unix-based web servers.]

An important step in setting up hosting of any web site is tailoring PHP to the needs of the code you will be running. You do this by changing PHP's initialization files which have the extension .ini. There is at least one initialization file, called php.ini, and there may be others.

Cloning Drupal sites - Part II: with root command-line access

This article is about making an exact duplicate of any live Drupal 6.x site onto one's local machine. It assumes you have a web server installed on your local machine and have root command-line access to the web server of the target site. It is the second and final part in a series of two articles. Part I addresses the case where you have (or use) only CPanel access.

Two tricks for debugging a Drupal WSoD

When working on custom Drupal modules in PHP, one commonly experiences the dreaded White Screen of Death (WSoD). The Drupal community has documented the Drupal WSoD extensively at http://drupal.org/node/158043.

Typically, everything seems fine, and then the Drupal-based web site you are working on (on your local machine) suddenly becomes completely broken, it gives a blank page for any request. Usually I cannot remember even what inconsequential-seeming things I have just changed. The tricks of this post are for directly tracking the down the error with a debugger, by watching it occur. [There is an even better method for this example, described at the end of this post.]

Speeding up Eclipse PHP debugging by using an external web browser

Today I got my environment for debugging PHP web pages working much more snappily, and I'm excited to share my tips. My experience only applies directly to you if you are running Eclipse and debugging PHP on a Macintosh with OS X.

Debugging locally using Eclipse, MAMP, and virtual domains

When setting up debug configurations for Eclipse, I often have my files living in a subdirectory of my web server root. For example, at directory drydock/ I have a full replica of whatever live site I am working on.

On my hosting, I have the same directory structure and a subdomain set up so that drydock.crotown.com maps to the drydock subdirectory. Then the site drydock.crotown.com lets me put changes on the web for testing and approval, before the actual live site is touched.

Robust popup links in Drupal 6

Once MIDI files were reliably playing in the browser (see the previous post), the next thing I wanted was to have them play in little popup windows, instead of making a blank new page and playing there. Having to hit the browser's "Back button" after playing any MIDI was not acceptable.

The first way I did this was to put the Javascript code to make the popup window inside the link (with an onclick attribute). The problem with that method is that the link is completely broken when Javascript is not supported. Clearly a new page to play the file is the best option when Javascript is not supported.

So, the question is, how can one get a popup when Javascript is supported, but have the link still go to a new page and load the file when it is not?

Drupal SEO