WordPress.org

Forums

[resolved] error in wp-config.php line 47. how to fix it? Thank you (18 posts)

  1. loveglass
    Member
    Posted 5 years ago #

    Could anyone please advice me what to do?

    Parse error: syntax error, unexpected ']' in /homepages/7/d259763837/htdocs/wordpress/wp love-glass/wp-config.php on line 47

    this how it looks without keys

    */
    define('AUTH_KEY', '...');
    define('SECURE_AUTH_KEY', '...');
    define('LOGGED_IN_KEY', '...);
    define('NONCE_KEY', '...');
    /**#@-*/ ......this is probably line 47

    Thanks for help

  2. You've got a bad character in your wp-config; below is what it should look like. Fill in your details in this copy and see http://codex.wordpress.org/Editing_wp-config.php

    <?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
     */
    
    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'putyourdbnamehere');
    
    /** MySQL database username */
    define('DB_USER', 'usernamehere');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'yourpasswordhere');
    
    /** MySQL hostname */
    define('DB_HOST', 'localhost');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**#@+
     * Authentication Unique Keys.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
     * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
     *
     * @since 2.6.0
     */
    define('AUTH_KEY', 'put your unique phrase here');
    define('SECURE_AUTH_KEY', 'put your unique phrase here');
    define('LOGGED_IN_KEY', 'put your unique phrase here');
    define('NONCE_KEY', 'put your unique phrase here');
    /**#@-*/
    
    /**
     * WordPress Database Table prefix.
     *
     * You can have multiple installations in one database if you give each a unique
     * prefix. Only numbers, letters, and underscores please!
     */
    $table_prefix  = 'wp_';
    
    /**
     * WordPress Localized Language, defaults to English.
     *
     * Change this to localize WordPress.  A corresponding MO file for the chosen
     * language must be installed to wp-content/languages. For example, install
     * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
     * language support.
     */
    define ('WPLANG', '');
    
    /* That's all, stop editing! Happy blogging. */
    
    /** WordPress absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    	define('ABSPATH', dirname(__FILE__) . '/');
    
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');
  3. loveglass
    Member
    Posted 5 years ago #

    Thank you. I thought there will be some character wrong but I checked your copy with mine and is exactly same?! Apart from I put there 'name, user, password, host" and made up my own authentitacion key. All before I installed on my 1and1 domain. From their customer service they said that the problem is in "We double checked on your account and found out that you are using PHP
    Version 4.4.9 - the old php version. Please try to upgrade to php 5 for
    you php version to sort this out". What shall I do now? Thank you

  4. Then upgrade to PHP 5. Ask your web host how to do that.

  5. loveglass
    Member
    Posted 5 years ago #

    This is it their answear
    "With 1&1 Linux hosting packages you have the choice between PHP 4 and
    PHP 5. To distinguish a script as PHP 5, simply name the script with the
    file extension .php5.

    While the PHP developers have done their utmost to ensure compatibility,
    we cannot guarantee that PHP 4 scripts will function 100% correctly
    under PHP 5.

    Please note that in contrast to PHP 4, the default for the variable
    RegisterGlobals and allow_url_fopen is "off".

    By default Apache uses PHP 4 for .php extension. If you don't want to
    rename all your scripts to .php5 you can do the following:

    Create a .htaccess file and place the following line AddType x-mapp-php5
    .php in it
    .

    This will tell Apache to use PHP 5 instead of PHP 4 for the extension
    .php in the directory the .htaccess is placed and all sub-directories
    under it.

    I have got access in to my website file through tfp/fetch only. How do i get there create a .htaccess? Sorry I might sound stupid but I am newbie in this and it's greek to me. thank you

  6. 1and1 does need that line in your .htaccess file. Go to the directory where you have wordpress installed and look for an .htaccess file that might already be there. The dot in front of htaccess is very important. If you don't see it at first, turn on invisible or unix file viewing in yur FTP client.

    If .htaccess isn't there, creat a new file with your FTP client, call it .htaccess and put

    AddType x-mapp-php5 .php

    in it. If an .htaccess file is already there, add that line at the top.

    This might not be the whole problem, but it's a place to start.

  7. loveglass
    Member
    Posted 5 years ago #

    Right. I created a file and put on my ftp. Then renamed it but not sure if is in a good directory. I am having now when I am trying to load my website this error

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, webadmin@kundenserver.de and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

    I am getting worst and worst. What have I done wrong?

    Thank you

  8. loveglass
    Member
    Posted 5 years ago #

    Oh... thank you. Let me try that

  9. loveglass
    Member
    Posted 5 years ago #

    My .htaccess is in different directory then wordpress files? Is this problem? Thank you

  10. You might have an .htaccess file in a different directory(s); if so, leave it (them) alone. Only change the one in the wordpress directory.

  11. loveglass
    Member
    Posted 5 years ago #

    Doesn't work for me. .htaccess file are not in my wordpress folder so I created file. It giving me still same error message :(
    1and1 service send me a mail now but I don't know what wrong in my ph-config!?!

    Please double check on the configuration of your wp-config.php file
    since that is causing the error. As much as we want to further assist
    you with this, scripting issue is already beyond our scope of support.

    How about delete from my account whole wp folder and start again? Would that put me back on my administration panel of my hosted domain?

    Thank you

  12. loveglass
    Member
    Posted 5 years ago #

    Here must be something wrong. I can't see it,can you?

    /**#@+
    * Authentication Unique Keys.
    *
    * Change these to different unique phrases!
    * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
    * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
    *
    * @since 2.6.0
    */
    define('AUTH_KEY', ')jd(re%FT~R43H!±*|}klV<>+ßdPZh:h"~ hj4_)*(&');
    define('SECURE_AUTH_KEY', '49H*)sec98RHBGs"|?sdlk.Q1ß,{hqG]d');
    define('LOGGED_IN_KEY', '%=KqR,£v dec\}ls-d±G~<D&£%^D']WOh,sqo£$f50.2g2 4');
    define('NONCE_KEY', '£9c*`Jk2,g'? JeSA,@ß8}JdFd~4 erklDjsss YOB&@|"{ veU*');
    /**#@-*/

  13. Download a fresh copy of wordpress; get the wp-config-sample.php from it. DON'T enter any secret keys, only MySQL database info. DON'T use Word to edit the file; use NotePad. Change the name to wp-config.php. Upload it.

  14. loveglass
    Member
    Posted 5 years ago #

    Hey sondogtech :-).
    I solved the problem thanx to you. I get back at beginning our chat and change the key and that's it! Still without access to my hosted domain's administration panel but... can say... I moved and load on my http://www.love-glass.co.uk.
    Loads work in the front of me... I know. That was only bloody 5 minutes installation :D
    Thank you

  15. All right!! Glad you got it installed OK. Have fun with it.

    Unfortunately, sometimes 5 minutes is more like 5 hours.....

  16. loveglass
    Member
    Posted 5 years ago #

    hi
    does anyone understand why I cant activate wp e-commerce plugin on 2.8.5 wp version? I am getting message on my screen

    Error 500 - Internal server error

    An internal server error has occured!
    Please try again later.

    So far no help. Please let me know if you know anything might cause this problem.

    Thank you

  17. Looks like a fix in this thread; seems to be particular to 1and1 hosting. They still call for the line AddType x-mapp-php5 .php in your .htaccess.

  18. loveglass
    Member
    Posted 5 years ago #

    Oh bless you. Thank you for that...It hard to solve the prob as you don't know where to start. Will start to work on it now. Thanks a lot :-)

Topic Closed

This topic has been closed to new replies.

About this Topic