Apr
02
2008

ctype_digit error in Wordpress 2.5

wordpress-image-uploadI've upgraded my blog to Wordpress 2.5 last weekend. The new design of the admin backend is great and seeing things evolve like that really motivates me to pour more time into my blog and add some nice little functionalities that I've been thinking about lately.

But it happens that I came upon an error when trying out the new image uploader and I'm sure many people will get it too:

PHP Fatal error: Call to undefined function ctype_digit() in wp-includes/link-template.php on line 182

What happens is that my flavor of PHP5 is not compiled with the ctype flag. This seems to be the default on Gentoo, so if you run it be sure to add the ctype use flag to your portage config. But if you can't recompile PHP, you can just open up the file wp-includes/link-template.php and replace the line 182 as follows:

Replace ctype_digit with is_numeric

That should do the trick until the version 2.5.1 that should patch things up according to what I see in the bug tracker (pending issue on link-template.php and a similar issue in another file already merged in 2.5).

Written by w00kie in: Random | Tags: ,

10 Comments »

  • Comment | April 3, 2008
    Ali

    Nice! You gotta come up with some crazy software of your own you computer freak!

  • Comment | April 3, 2008
    Marwan

    Geek

  • Comment | April 3, 2008
    Marwan

    Ali, you should try some of these things to enlighten your sad sad blog …

  • Comment | April 3, 2008
    e

    Running Wordpress 1.5.2, I think I should upgrade. At least for spam filtering to be upgraded. Hum. But now I’m afraid. Bahhhh.

  • Comment | April 3, 2008

    dude, if you want I will upgrade it for you!
    really, I won’t be able to sleep at night knowing you’re running such a backwards version

  • Comment | April 13, 2008

    Thanks!

  • Comment | April 19, 2008

    Ah, perfect! Changing one line is much less hassle than recompiling PHP. Thanks a lot!

  • May 13, 2008
    Pingback from: WordPress LAB » WordPress 2.5
  • Comment | July 20, 2008

    To E:

    Yikes, and I feel bad about leaving some of the production WordPress installations at 2.5.x … never mind 1.5 – upgrade that installation ASAP.

    To Wookie:

    That indeed is the detailled technical fix for the bug, although the best choice is WP 2.6 now, or at least the officially patched link-template.php file :)

    Details in my article:
    http://www.robinmajumdar.com/2008/07/19/wordpress-error-message-call-to-undefined-function-ctype_digit-in-wordpresswp-includeslink-templatephp-bug-fix-here/

  • Comment | July 2, 2009

    Great link Robin, thanx.

    With the release of wordpress 2.8 we can kiss these issues GOOD BYE! :D

RSS feed for comments on this post. TrackBack URL

Leave a comment

For a cool icon next to your comment, use gravatar.

Powered by WordPress. Theme adapted from Aeros.