• Hello!

    I am a pretty basic user and just logged in for the first time in (embarrassingly) several months. After updating my php and updating to the newest wordpress, I now seem to have an error that shows at the top of my website:

    Warning: Use of undefined constant DATABASE_SERVER – assumed ‘DATABASE_SERVER’ (this will throw an Error in a future version of PHP) in /home/customer/www/taylorstoneillustration.com/public_html/wp-config.php on line 32

    Any idea how to solve this? (I don’t even remember how to get to editing code directly after all this time, so please be patient with me and assume I’m starting at step 0.)

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    In your wp-config.php file, you define the database server…. something like

    / ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'wplocal' );
    
    /** MySQL database username */
    define( 'DB_USER', 'xxxxx' );
    
    /** MySQL database password */
    define( 'DB_PASSWORD', 'xxxxx' );
    
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost' );
    

    It sounds like someone’s used “DATABASE_SERVER” instead of “DB_HOST”, although DATABASE_SERVER is not a constant normally used by WP.

    I suggest you take a look at wp-config.php using your hosting control panel (or download via FTP) because whatever’s squirelly is there around line 32. Please post the database related lines, X’ing out any users and passwords.

    Thread Starter davidwileycabinetmaker

    (@davidwileycabinetmaker)

    Hi thanks for the help! So is there no way to fix it through my website dashboard? Or do I have to do it through my host control panel. (I use siteground, and can’t find my complete code anywhere on there)

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You need to do it through your hosting control panel. I suggest you contact SG support. I just checked all of WordPress’ code and DATABASE_SERVER, as a constant, is not used, so this may be in some custom plugin or theme. But the root cause seems to be that it’s not defined (or not defined properly, in the sense of the PHP “define” statement) in your wp-config.php. So, that’s the place to start.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Use of Undefined Constant Database Server Error’ is closed to new replies.