WordPress.org

Ready to get started?Download WordPress

Forums

Problem with config.php file (9 posts)

  1. Phil Gee
    Member
    Posted 3 years ago #

    Parse error: syntax error, unexpected $end home/******/public_html/wp-config.php on line 2

    I recently moved a client's site to a new hosting provider because the previous provider did not support php version 5

    This morning I was updating his plugins and received this message-

    define('WP_CACHE', true); //Added by WP-Cache Manager

    at the top of my screen. Further messages suggested that I move this line of code to a position above the following line of code

    */require_once(ABSPATH . 'wp-settings.php');

    When I downloaded the config.php file I saw that the intial line of code was indeed above the second line anyway.

    This is what the opening lines of the file look like

    "
    define('WP_CACHE', true); //Added by WP-Cache Manager
    <?php/** * The base configurations of the WordPress. * * This file has the following configurations: MySQL settings, Table Prefix ..."

    Apart from the first line all the other code is on the same line. I now only have the above error report when trying to view the client's site- I only have access via ftp.

    I'm not trained in using code so learn by trial and error and the goodwill of friends and people on these forums-

    Please help me to rectify the issue with the config.php file,

    thanks,

    Phil

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    that define line definitely needs to be moved down in the code.... it needs to be at least under the first line, which has the opening <?php tag, anything added needs to be inside that tag

    Any defines that I add to my wp-config file I always put just above the stop editing/happy blogging line

  3. Phil Gee
    Member
    Posted 3 years ago #

    Thanks Rev. Voodoo, will try that

  4. Phil Gee
    Member
    Posted 3 years ago #

    Now receiving this error message

    Fatal error: Call to undefined function wp() in /home/*******/public_html/wp-blog-header.php on line 14

    Any clues?

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    in the default, line 14 is within this:

    <?php
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, WordPress Language, and ABSPATH. You can find more information
     * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
     * wp-config.php} Codex page. You can get the MySQL settings from your web host.
     *
     * This file is used by the wp-config.php creation script during the
     * installation. You don't have to use the web site, you can just copy this file
     * to "wp-config.php" and fill in the values.
     *
     * @package WordPress
     */

    which is all just commented out instructions..... what is different in yours?

  6. Phil Gee
    Member
    Posted 3 years ago #

    Just tried something else and now have a new error message

    Parse error: syntax error, unexpected $end in /home/******/public_html/wp-config.php on line 1

    which would appear to be <?php

  7. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    does it look exactly as above? That should be the exact first bit of your code....

    You may wish to try downloading a fresh wp, and grabbing the wp-config sample out of it, and putting all your info into it, to see if you can rebuild, if you can't figure out what's going on.... or at least use it to compare.... I'm not sure what's going on with your file

  8. Phil Gee
    Member
    Posted 3 years ago #

    Thanks once again Rev. Voodoo

    I have sorted out the problem by reverting back to an old version of the site,

    Cheers,

    Phil

  9. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    Glad you got it sorted out!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags