2008 March

Using Xampp on Mac for Ruby on Rails

| development (web) | 5 Comments

I recently installed Xampp on my mac to help with some other development work, only to find that my previous install of MySQL which I was using for Ruby on Rails development no longer worked. I was receiving errors:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

and

No such file or directory – /tmp/mysql.sock

To fix the problem, I added the following line to config/database.yml

socket: /Applications/xampp/xamppfiles/var/mysql/mysql.sock

Huge thanks to http://soledadpenades.com/ who had the solution.

Chmod MODx MaxiGallery fix

| development (web) | 8 Comments

MaxiGallery is a customizable image gallery for the PHP application framework/CMS MODx. I have been testing it out locally on a windows based PC running Apache, and came across an error when trying to upload files as per the Picture and Thumbnails walkthrough.

« MODx Parse Error »

MODx encountered the following error while attempting to parse the requested resource:

« PHP Parse Error »
PHP error debug
Error: chmod() [function.chmod]: No such file or directory
Error type/ Nr.: Warning – 2
File: assetssnippetsmaxigallerymaxigallery.php
Line:372
Line 372 source: chmod($mg->path_to_gal.$name,0666);

The fix thanks to doze on the modxcms forums:

Try changing lines 371 – 378 in maxigallery.php from:
Code:

move_uploaded_file( $_FILES['file'.$i]['tmp_name'] , $mg->path_to_gal.$name );
chmod($mg->path_to_gal.$name,0666);

$handleMessage = $mg->handleFile($name, $modx->db->getRecordCount($rsx));
if ($handleMessage != “”) {
$manageOuterTplData['messages'] .= $handleMessage;
$upload_error = true;
}

to:
Code:

if(move_uploaded_file( $_FILES['file'.$i]['tmp_name'] , $mg->path_to_gal.$name )) {
chmod($mg->path_to_gal.$name,0666);

$handleMessage = $mg->handleFile($name, $modx->db->getRecordCount($rsx));
if ($handleMessage != “”) {
$manageOuterTplData['messages'] .= $handleMessage;
$upload_error = true;
}
}

This worked for me without needing to do the other changes that he mentioned in the post, but if it doesn’t work for you, try checking out the rest of his comments.