Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: How do I reconnect the database?

Hybrid View

  1. #1

    How do I reconnect the database?

    My host messed up and now my blog shows:

    Fatal error: Call to undefined function wp_initial_constants() in /home/rhesusn2/public_html/work/wp-settings.php on line 26

    What am I looking for in the file and how do I fix this?

    Thanks.
    I am also a writer for Serpholic Media. You can find some of my articles here: Serpholic Media Blog

  2. #2
    It is probably not a database issue. It looks like a PHP script is missing or corrupted.

    Function Reference/wp initial constants WordPress Codex

    wp_initial_constants() is located in wp-includes/default-constants.php
    You can manually copy that file to the server using an FTP utility. If you get any more errors, the last WordPress update failed. Just manually copy all of the core files for the current version of WordPress.

    If your host is GoDaddy, I've seen other problems like this recently with WordPress files somehow getting corrupted. Something is screwed up on their servers.
    "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- Benjamin Franklin


  3. #3
    Just checked and default-constants.php is an empty file. Do I simply copy this file in there?

    default-constants.php in tags/3.5.1/wp-includes – WordPress Trac
    I am also a writer for Serpholic Media. You can find some of my articles here: Serpholic Media Blog

  4. #4
    Yes. It should not be an empty file. The file probably got corrupted.

    If you are running version 3.5.1, then copy that file to the server. I would download a copy of WordPress 3.5.1. and simply copy the default-constants.php file and overwrite the empty file.

    If this happened as a result of an update, you may find other files that are corrupted. I have never found the WordPress update system to be 100% reliable. It works well on some hosts, but not on others.
    "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- Benjamin Franklin


  5. #5
    Ok, it worked. Thanks a lot!

    I also have an SMF forum hosted on the same server:

    http://rhesusnegative.net/rhnegativeforum/

    Connection Problems
    Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

    Any idea how to fix this?
    I am also a writer for Serpholic Media. You can find some of my articles here: Serpholic Media Blog

  6. #6
    I am not familiar with SMF and the error does not tell me much. Did both errors occur at the same time? Perhaps your host had a problem and restored the sites from a corrupted backup, or they have a hard drive going bad.

    Have you had the hosting company look at the problem?

    Do a search in Google for "Sorry, SMF was unable to connect to the database" in quotes. It looks like a common problem. There are hundreds of thousands of pages covering this topic. Start reading through them until you see something that makes sense.

    It looks like the error is comonly caused by too many DB connections, which means your site could be getting hit hard by a DOS attack or too many bots or spammers. Chinese comment spammers recently took down my VPS server until I figured it out and blocked access for most of China.
    "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- Benjamin Franklin


  7. #7
    Thanks, found a thread on their forum
    Sorry, SMF was unable to connect to the database. This may be caused by the ser

    Uploaded the test file:

    http://rhesusnegative.net/rhnegativeforum/test.php

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'rhenf'@'localhost' (using password: NO) in /home/rhesusn2/public_html/rhnegativeforum/test.php on line 5
    Access denied for user 'rhenf'@'localhost' (using password: NO)


    Getting there.
    I am also a writer for Serpholic Media. You can find some of my articles here: Serpholic Media Blog

  8. #8
    Quote Originally Posted by Mike Dammann View Post
    Thanks, found a thread on their forum
    Sorry, SMF was unable to connect to the database. This may be caused by the ser

    Uploaded the test file:

    http://rhesusnegative.net/rhnegativeforum/test.php

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'rhenf'@'localhost' (using password: NO) in /home/rhesusn2/public_html/rhnegativeforum/test.php on line 5
    Access denied for user 'rhenf'@'localhost' (using password: NO)


    Getting there.
    seem like you facing same problem like me .... there way too many hacker out there.
    how i solve ? i change to mybb, much lighter script and smooth

  9. #9
    I have just detected a major security hole in SMF. Unbelievable really.

    Quote Originally Posted by SonnyCooL View Post
    seem like you facing same problem like me .... there way too many hacker out there.
    how i solve ? i change to mybb, much lighter script and smooth
    Well, I will stick with it for a while. Moving it to phpbb sounds like a pain to me.


    I also like the look of smf a lot more.


    But that's beside the point.

    They are running a repair for me now. Stay tuned.
    I am also a writer for Serpholic Media. You can find some of my articles here: Serpholic Media Blog

  10. #10
    I have a private family forum built on phpBB. It is not very difficult to work with, and there is a lot of user support. But updates are a pain in the rear--especially if you have modified the forum in any way.
    "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- Benjamin Franklin


Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •