WordPress.org

Ready to get started?Download WordPress

Forums

WordPress database error (8 posts)

  1. dmoola
    Member
    Posted 8 years ago #

    I just brought home a new computer which I installed redhat on. I've never had problems with wordpress until I installed it on this new box and moved everything over.

    1) wordpress isn't find my plugins directory... but that's not a big deal since it's not visible to users

    2) where the page links shound be at the bottom of my front page...i get a sql error:

    WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1]
    SELECT COUNT(ID) FROM

    (you can see this on http://blog.danielkenneth.com)

    I checked the apache logs and I have thousands of lines reporting the same pcre_fullinfo() error on several files:

    PHP Warning: preg_match: internal pcre_fullinfo() error -3 in /usr/local/apache2/htdocs/blog/wp-includes/vars.php on line 31

    PHP Warning: preg_match: internal pcre_fullinfo() error -3 in /usr/local/apache2/htdocs/blog/wp-includes/wp-db.php on line 154

    I downloaded the latest Zend, Apache, php and installed them all like I always did in the past. I copied my database from the old server and uploaded my theme that I had been using.

    I've been pulling my hair out...why am I getting this error where the page links should be???

    Daniel

  2. This looks like you may have a mismatch between the versions of php/mysql/apache installed.

    Can you confirm which versions you have installed and maybe setup a phpinfo page to confirm that all the modules have loaded ok?

  3. dmoola
    Member
    Posted 8 years ago #

    Sure!

    http://blog.danielkenneth.com/phpinfo.php

    Apache: 2.0.54
    PHP: 5.0.4
    MySQL: 14.7 Distrib 4.1.12

    Is there a list somewhere of what is compatible? I figurd the newest would be the best route.

    Daniel

  4. Ok those look good.

    Reading the error message again makes me think that something is generating dodgy SQL queries what do you have in you themes index.php underneath the POST loop where that error message is appearing?

    Could you post the source of your themes index.php somewhere to examine?

  5. dmoola
    Member
    Posted 8 years ago #

    http://blog.danielkenneth.com/wp-content/themes/benevolence/index.phps

    There it is... I don't want to think it's the theme...i've been using it for a long time and never had a problem before...

    *pulls more hair out*

  6. dmoola
    Member
    Posted 8 years ago #

    and here is the offending code (i think) from wp-includes/template-functions-links.php


    function posts_nav_link($sep=' — ', $prelabel='« Previous Page', $nxtlabel='Next Page »') {
    global $request, $posts_per_page, $wpdb, $max_num_pages;
    if (! is_single()) {

    if (get_query_var('what_to_show') == 'posts') {
    if ( ! isset($max_num_pages) ) {
    preg_match('#FROM (.*) GROUP BY#', $request, $matches);
    $fromwhere = $matches[1];
    $numposts = $wpdb->get_var("SELECT COUNT(ID) FROM $fromwhere");
    $max_num_pages = ceil($numposts / $posts_per_page);
    }
    } else {
    $max_num_pages = 999999;
    }

    if ($max_num_pages > 1) {
    previous_posts_link($prelabel);
    echo preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $sep);
    next_posts_link($nxtlabel, $max_page);
    }
    }
    }

  7. Ok.

    Wading through the following php bug reports it looks like the version of PHP you have is built in such a way that the PCRE stuff won't work - you should try a different PHP version and see if that fixes the issue - try 4.4.0 for example instead.

    php Bugs:
    http://bugs.php.net/bug.php?id=29158
    http://bugs.php.net/bug.php?id=29914
    http://bugs.php.net/bug.php?id=31501

    hope this helps

  8. dmoola
    Member
    Posted 8 years ago #

    great research, i will definately try that. at least now i know i'm not alone or crazy :)

Topic Closed

This topic has been closed to new replies.

About this Topic