- Node management script
- Easy recipe for posting events with signups on your website
- Handling PDO:_construct error on XAMPP
- Merit badges and counselors for Boy Scout site
- Easy Recipe for a photo gallery with a slideshow block
- How much should a website cost?
- From "Brochureware" to "Communityware"
- rgrep
- Limiting number of characters allowed in a profile field
- Why build websites using Drupal?
Handling PDO:_construct error on XAMPP
Drupal 7 now uses php data objects (PDO). The configuration file sites/default/settings.php now has lots of fanciness to support the variety of ways that it's possible to connect to a variety of databases.
If you're on XAMPP and you get a PDO:_construct error, I'll bet it's the unix socket. Here's the fix. Locate the section that specifies your database, username, and password, and add a 'unix_socket' line like below.
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'database_name',
'username' => 'database_username',
'password' => 'database_user_password',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
'unix_socket' => '/opt/lampp/var/mysql/mysql.sock',
),
),
);
According to the D7 issue queue on drupal.org, Drupal is smart enough to ignore port and other stuff when it sees the unix_socket switch.
Cool, huh?
