• Hello,

    I recently installed WP on a home server, I had a blast setting up the server locally, but son realised that it was troublesome to get it online. I ended up getting it online with IPv6 (and laods of messing around with files). In fact I messed around with wp-config to try to set the WP up so I could log on as an admin from the internet.

    First of all it didnt work
    and PHP died on my server

    So I need help to get php running (pure html looks so sad)
    my error log says theres a php parse error at line 84 of wp-config an unexpected ‘,’. However this line is a comment /**/, so this is compiler BS.

    WP_debug tells me I use an undefined constant DB_NAME in includes/load.php

    I will provide any info you need

    Best,
    René

Viewing 5 replies - 1 through 5 (of 5 total)
  • Dion

    (@diondesigns)

    It’s possible that deleting your (five-character) line 84 will solve the problem. However, when comments are involved, the error causing the problem is oftentimes on an earlier line than what was flagged by the PHP parser.

    Please post your wp-config.php file inside a CODE block. For your own security, make sure to replace the database entries with random characters. I’m sure someone will be able to help you fix your broken wp-config.php file.

    Thread Starter Madwar

    (@madwar)

    Hello, here is my wp-config contents:

    <?php
    /**
     * The base configurations of the WordPress.
     *
     * This file has the following configurations: MySQL settings, Table Prefix,
     * Secret Keys, and ABSPATH. You can find more information by visiting
     * {@link https://codex.wordpress.org/Editing_wp-config.php Editing wp-config.p$
     * 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', 'wordpress');
    
    /** MySQL database username */
    define('DB_USER', 'username');
    
    /** MySQL database password */
    define('DB_PASSWORD', 'password');
    
    /** MySQL hostname */
    define('DB_HOST', 'hostname');
    
    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET', 'utf8mb4');
    
    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');
    
    /**#@+
     * Authentication Unique Keys and Salts.
     *
     * Change these to different unique phrases!
     * You can generate these using the {@link https://api.wordpress.org/secret-key$
     * You can change these at any point in time to invalidate all existing cookies$
     *
     * @since 2.6.0
     */
    define('AUTH_KEY',         'key0');
    define('SECURE_AUTH_KEY',  'key1');
    define('LOGGED_IN_KEY',    'key2');
    define('NONCE_KEY',        'key3');
    define('AUTH_SALT',        'key4');
    define('SECURE_AUTH_SALT', 'key5');
    define('LOGGED_IN_SALT',   'key6');
    define('NONCE_SALT',       'key7');
    /**#@-*/
    
    /**
     * 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_';
    
    /**
     * For developers: WordPress debugging mode.
     *
     * Change this to true to enable the display of notices during development.
     * It is strongly recommended that plugin and theme developers use WP_DEBUG
     * in their development environments.
     */
    define('WP_DEBUG', true);
    
    /* That's all, stop editing! Happy blogging. */
    
    /** 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');
    
    /*
    define('WP_HOME','IPV6');
    define('WP_SITEURL','IPV6');
    */

    It’s possible that deleting your (five-character) line 84 will solve the problem. However, when comments are involved, the error causing the problem is oftentimes on an earlier line than what was flagged by the PHP parser.

    Not that familiar with web-coding, but in any other code scenarios comments should not be interpreted. So I assume my error is in another part of the code
    `

    Thread Starter Madwar

    (@madwar)

    DB_COLLATE is empty, Ill try to have a look at that..
    Also one of the key strings contain a ‘;’, however refering to non-web-coding experience it should not be a problem within a string declaration.

    Dion

    (@diondesigns)

    One thing I immediately notice is that the following line is going to cause a problem:

    /** The name of the database for WordPress *

    It should be this:

    /** The name of the database for WordPress */

    Without the trailing slash, everything following that line will be considered a comment until a */ pair is encountered. This is exactly why I said that the error could be somewhere other than what PHP flagged.

    Thread Starter Madwar

    (@madwar)

    Aha, thank you I didn’t notice!
    Fixing the comment removed the debugging message with regards to the database and I am able to visit my site, but the site percists to shown purely in html (as a menu ie. the theme I setup is not shown)

    In the page source code I see references like:

    <link rel='stylesheet' id='siteorigin-panels-front-css'  href='http://IPV6ADDR/wp-content/plugins/siteorigin-panels/css/front.css?ver=2.1.4' type='text/css' media='all' />

    where
    http://IPV6ADDR/&#8230; ‘
    should be
    http://[IPV6ADDR]/&#8230; ‘
    for the address to be recognised correctly

    I will google around, if you have a comment on this, I would appreciate it too.

    Thank you,
    René

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP died’ is closed to new replies.