Code snippets: July 2007 Archives

Movable Type is a great CMS/Blog system built on Perl and version 4 was recently release for betatesting. However, the release candidate is not without bugs. Here are some problems and solutions I came up with:

500 Internal Server error on rebuild/Image upload (specially PNG).
Either you are running out of memory, or you'r Image::Magick installation is either broken or missing. If you visit http://www.yourdomain.com/cgi-bin/movabletype/mt-check.cgi and scroll down to "Image::Magick", does it appear as valid? Or does it say it's missing.

Either way (there have been reports that users with apparently OK installations is helped by this too) try using NetPBM instead. Follow this guide:

http://sniptools.com/tutorials/thumbnailing-with-netpbm-and-movable-type

Using NetPBM with PNGs (... or File not found /path/to/mt/topnm"
Movable Types default NetPBM settings does not allow pngs (possible Movable Types default settings for Image::Magick either). Locate your Image.pm  (In movabletype/MT folder), line 1XX (122 probably) and change:

my %Types = (jpg => 'jpeg', gif => 'gif');

To:

my %Types = (jpg => 'jpeg', gif => 'gif', png => 'png');

Otherwise you will get a "file not found: /users/home/etc/netpbm/topnm" error. Solution originally found on http://forums.sixapart.com/index.php?showtopic=54246

No entry ID on comments/commenting
Short answer: Make sure you have www in your CGIPath on mt-config.cfg (or remove it if you have).

Longer answer: This has to do with POST redirecting problems. Make sure your CGIPath in mt-config.cfg reflects your sites www-structure. If your adress is: http://www.domain.com/cgi-bin... You must include the www in CGIPath. But if your adress is http://domain.com/cgi-bin.. you must remove the www.

500 internal server error on commenting (... with NetPBM)
This could have several reasons. Start by turning off E-mail notifications (to make sure your sendmail isn't causing the trouble), then set "" to anyone. Also, see http://www.sixapart.com/movabletype/kb/comments/500_on_comment.html if their solution works.

If nothing else, you might have the same rather obscure error as me. NetPBM cannot produce CAPTCHA images, you will find this in your comment settings:

"No CAPTCHA provider is available in this system. Please check to see if Image::Magick is installed, and CaptchaImageSourceBase directive points to captcha-source directory under mt-static/images."

However, this does not stop MT from trying to initiate Captcha (even if it would later choose not to use it). Open lib/MT/App/Comments.pm and comment out (add # at the start of the line) in init(), from:

$app->init_captcha_providers();

to:

#$app->init_captcha_providers();

And your problem (might be solved), mine was.
Recently I implemented support for double, stand-alone y-axis in Open Flash Charts. Turns out that John Glazebrook (main coder) has gotten "LOTS of requests for 2 Y axis" and my contribution will be included in the next release of Open Flash Charts. That way all users can benefit from my modifications..

Technical details (to other Open Flash Charts users)
If you want to try out double y-axis before the next release, download my open-flash-chart.swf and add this to your data file:

&y2_axis_colour=#164166&        // Same as regular documentation
&y2_label_style=10,0x164166&    // Same as regular documentation
&show_y2=true&            // Do we use double axels?
&y2_lines=1&            // Which of the lines should be drawn based on the y2-axel? (1,2,3 etc)
&y2_left=70&            // Left margin (how far left should we push the regular content)
&y2_min=0&            // Same as regular documentation
&y2_max=2400&            // Same as regular documentation
&y2_legend=Free Ram (mb),12,0x164166& // Same as regular documentation

Good luck! If you got any questions, simply contact me

About this Archive

This page is a archive of entries in the Code snippets category from July 2007.

Code snippets: August 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Code snippets: July 2007: Monthly Archives

Powered by Movable Type 4.21-en