• Dear Support team,

    My website is hosted on an AWS EC2 instance with a starting WordPress image by Bitnami.
    When I tried to redirect all the traffic from HTTP -> HTTPS, by following advices on this thread, I could not access my website anymore. Briefly, I made the following changes in the wp-config.php file:

    
    #define('WP_SITEURL','https://' . $_SERVER['HTTP_HOST'] . '/');
    #define('WP_HOME','https://' . $_SERVER['HTTP_HOST'] . '/');
    define('WP_SITEURL', 'https://www.advokatvladica.tk');
    define('WP_HOME', 'https://www.advokatvladica.tk');
    

    and applied the following command on the apache server:

    
    sudo mysql -u bn_wordpress -p -e "USE bitnami_wordpress; select option_name,option_value from wp_options WHERE option_name='siteurl' OR option_name='home';"
    

    This caused the site to crash. Subsequently, I tried to manually bring the state back by undoing the changes (since I did not have a backup :(). Nevertheless, the problem persisted.

    Meanwhile, I modified the wp-config.php file again for debbuging and I am pasting here a part of the debug.log file:

    
    [17-Dec-2020 15:03:27 UTC] PHP Warning:  array_keys() expects parameter 1 to be array, string given in /opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-roles.php on line 289
    [17-Dec-2020 15:03:27 UTC] PHP Warning:  Invalid argument supplied for foreach() in /opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-roles.php on line 289
    [17-Dec-2020 15:03:27 UTC] PHP Fatal error:  Uncaught Exception: DateTimeZone::__construct(): Unknown or bad timezone (https://www.advokatvladica.tk) in /opt/bitnami/apps/wordpress/htdocs/wp-includes/script-loader.php:331
    Stack trace:
    #0 /opt/bitnami/apps/wordpress/htdocs/wp-includes/script-loader.php(331): DateTimeZone->__construct()
    #1 /opt/bitnami/apps/wordpress/htdocs/wp-includes/script-loader.php(541): wp_default_packages_inline_scripts()
    #2 /opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php(287): wp_default_packages()
    #3 /opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters()
    #4 /opt/bitnami/apps/wordpress/htdocs/wp-includes/plugin.php(551): WP_Hook->do_action()
    #5 /opt/bitnami/apps/wordpress/htdocs/wp-includes/class.wp-scripts.php(167): do_action_ref_array()
    #6 /opt/bitnami/apps/wordpress/htdocs/wp-includes/class.wp-scripts.php(142): WP_Scripts->init()
    #7 /opt/bitnami/apps/wordpress/htdocs/wp-includes/functions.wp-scripts.php(24): WP_Scripts->__construct()
    #8 /opt/bitnami/apps/wordpress/htdocs in /opt/bitnami/apps/wordpress/htdocs/wp-includes/script-loader.php on line 331
    

    Although I tried to search for similar issues on the forum, I did not find helpful solutions for this particular problem.

    Perhpas you guys can help me with this problem?

    Thanks in advance!

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

Viewing 1 replies (of 1 total)
  • This might work:

    1. Backup your site files and database. even though it’s down everything should still be recoverable
    2. Download a fresh copy of WordPress extract the wp-config-sample.php file
    3. rename wp-config-sample.php to wp-config.php and replace the following lines with the lines from your original wp-config.php
      
      // ** MySQL settings - You can get this info from your web host ** //
      /** The name of the database for WordPress */
      define( 'DB_NAME', 'local' );
      
      /** MySQL database username */
      define( 'DB_USER', 'root' );
      
      /** MySQL database password */
      define( 'DB_PASSWORD', 'root' );
      
      /** MySQL hostname */
      define( 'DB_HOST', 'localhost' );
      
    4. rename your original wp-config.php to something like wp-config-old.php and upload the new wp-config.php to your site. ( wp-config-old.php is just a temporary backup that is easier to retrieve than your main backup and should be deleted as soon as your site is back online. )

    Hopefully, you have access to your site now.

    PS the MySQL command doesn’t appear to do anything.

Viewing 1 replies (of 1 total)

The topic ‘Crashed site after editing wp-config.php’ is closed to new replies.