Monthly Archive for September, 2008

My Head Radio

A colleague of mine is the founding member of the My Head Radio band and last September 11th, on his birthday, My Head Radio has released both their new website – myheadradio.com – and their debut album: On Air. Great music, great lyrics and an awesome designed logo!

Oh, btw, just keep an open mind towards the music because it’s something totally different then you are probably used to but it’s a completely wicked sound!!

WP Fix: what to do when visual text editor jams

In order to get the code in the previous post I installed WP-Syntax and learned pretty quickly that the plugin ruins the visual text editor functionality… arrggg!

Simply uninstalling the plugin wasn’t good enough so after some research on the WordPress Support Forum I came across the following procedure to fix the issue:

  1. Disable (and if needed remove) the plugin which causes the visual text editor of functioning normally.
  2. Clear the browsers cache (in Firefox, use the Clear Private Data menu) and restart the browser.
  3. Go to /wp-includes/js/tinymce/tiny_mce_config.php and find the following line:
    'compress' => true,

    and change the true value into false.

  4. Log on to your WordPress admin area and now the visual text editor should be functional again.
  5. If everything is working you can now undo the code change of step 3.

As you can see, the WP-Syntax plugin is still running and I can still use the visual text editor but that will take some modifications of the WP-Syntax code. I will post those changes later this week.

WP Fix: automatic update open_basedir error

In WordPress 2.7 there is a nice feature to automatically update plugins or the core via one simple click on a link. For quite a while I couldn’t get it to work as it was producing errors like:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/tmp//1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-includes/functions.php on line 1960

Warning: touch() [function.touch]: open_basedir restriction in effect. File(/var/tmp/1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-admin/includes/file.php on line 122

Warning: fileowner() [function.fileowner]: open_basedir restriction in effect. File(/var/tmp/1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-admin/includes/file.php on line 487

Warning: unlink() [function.unlink]: open_basedir restriction in effect. File(/var/tmp/1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-admin/includes/file.php on line 489

This morning I finally found THE hint that has lead me to the solution to fix it and to be honest it was amazingly simple!!

WordPress is trying to use the wrong path, duhh, but the correct path is also provided in the error message. In my case I have to point WordPress to the /tmp path instead of the found /var/tmp path!!

When you follow the error messages you finally end up in the get_temp_dir function (/wp-admin/includes/file.php:97) which basically provides the answer straight away after you run a full source code search on WP_TEMP_DIR…

function get_temp_dir() {
 if ( defined('WP_TEMP_DIR') )
 return trailingslashit(WP_TEMP_DIR);

So the solution is to define WP_TEMP_DIR in the wp-config.php file:

define('WP_TEMP_DIR','/tmp');

Happy auto updating!