database connection error

I am having a database connection error on wordpress.

After a post, the site spins for a long time and gives one liner database connection issue. Sometimes, the site shows wordpress error page "Error establishing a database connection" and wants me to check wp-config.php and states cant contact the database server.

When I check the log. I see…

[error] PHP Fatal error: Call to undefined function wpcacheget() in /srv/www/example.com/public_html/wp-includes/functions.php on line 346

I checked on line 346````
$notoptions = wpcacheget( 'notoptions', 'options' );

from line 344 to 350````
    if ( ! defined( 'WP_INSTALLING' ) ) {
        // prevent non-existent options from triggering multiple queries
        $notoptions = wp_cache_get( 'notoptions', 'options' );
        if ( isset( $notoptions[$option] ) )
            return $default;

        $alloptions = wp_load_alloptions();

I have

mysql 5.1.41

wordpress 3.2.1

apache

for cache I have w3tc

???

I am on lamp set up.

thank you.

4 Replies

I followed a few of the threads, and seemed to solve the issue

these links should help anyone that has the same issue

http://library.linode.com/troubleshooti … networking">http://library.linode.com/troubleshooting/memory-networking

http://library.linode.com/lamp-guides/u … 0.04-lucid">http://library.linode.com/lamp-guides/ubuntu-10.04-lucid

The second link is broken

http://library.linode.com/lamp-guides/u … 0.04-lucid">http://library.linode.com/lamp-guides/ubuntu-10.04-lucid

@awordpresslife:

The second link is broken

http://library.linode.com/lamp-guides/u … 0.04-lucid">http://library.linode.com/lamp-guides/ubuntu-10.04-lucid

This is most likely because 10.04 isn't supported at all by Canonical at this point. If you're using Ubuntu 10.04 I'd really recommend upgrading to a more recent version of Ubuntu to avoid running into complications.

If you're actually running a more recent version, these guides should be applicable:

https://www.linode.com/docs/websites/la … e-pangolin">https://www.linode.com/docs/websites/lamp/lamp-server-on-ubuntu-12-04-precise-pangolin

https://www.linode.com/docs/websites/la … untu-14-04">https://www.linode.com/docs/websites/lamp/how-to-install-a-lamp-stack-on-ubuntu-14-04

If you're not running Ubuntu at all, we have guides for CentOS 6/7, Debian 7/8 and Arch Linux as well:

https://www.linode.com/docs/websites/lamp/

Hope this helps!

@awordpresslife:

The second link is broken

http://library.linode.com/lamp-guides/u … 0.04-lucid">http://library.linode.com/lamp-guides/ubuntu-10.04-lucid

It's a 4.5 year old post…

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct