Unable to login, changing wp-config.php workaround

Bug Summary

When creating a new local site you are unable to login. You are not given a failed login message but are redirected back to the login again.

Steps to reproduce

  1. Create new local site
  2. Go to local site wp-admin
  3. Try to login with credentials
  4. You should now be redirected to the login page and no messages regarding failed login

Environment Info

  • What Operating System are you using?
    Windows 11 Pro (10.0.22621)
  • What versions of site software (Nginx, Apache, PHP, MySQL) is used?
    Nginx
    PHP 8.1.9
    MySQL 8.0.16
    WordPress 6.2.2
    Multisite No
  • What version of Local is installed?
    Version 7.0.1+6387

Supporting info

Please provide your Local Log. See this Community Forum post for instructions on how to do so:
local-lightning.log

{"localVersion":"7.0.1+6387","osPlatform":"win32","osRelease":"10.0.22621","osArch":"ia32","windowsEdition":"Microsoft Windows 11 Pro","linuxEdition":null,"level":"warn","message":"Electron Event ready","timestamp":"2023-06-16T09:31:38.918Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-06-16T09:32:04.296160Z 0 [System] [MY-010116] [Server] %%resourcesPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe (mysqld 8.0.16) starting as process 15212","timestamp":"2023-06-16T09:32:05.793Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-06-16T09:32:04.297341Z 0 [Warning] [MY-013243] [Server] --character-set-server: The character set UTF8MB3 is deprecated and will be removed in a future release. Please consider using UTF8MB4 instead.","timestamp":"2023-06-16T09:32:05.794Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-06-16T09:32:05.750533Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.","timestamp":"2023-06-16T09:32:05.794Z"}
{"thread":"main","class":"Process","process":"mysql","level":"warn","message":"2023-06-16T09:32:05.793695Z 0 [System] [MY-010931] [Server] %%resourcesPath%%\\lightning-services\\mysql-8.0.16+6\\bin\\win64\\bin\\mysqld.exe: ready for connections. Version: '8.0.16'  socket: ''  port: 10091  MySQL Community Server - GPL.","timestamp":"2023-06-16T09:32:05.795Z"}

I have found if you change the wp-config.php layout it solved the issue
Orignal Format

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the web site, you can copy this file to "wp-config.php"
 * and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * Database settings
 * * Secret keys
 * * Database table prefix
 * * Localized language
 * * ABSPATH
 *
 * @link https://wordpress.org/support/article/editing-wp-config-php/
 *
 * @package WordPress
 */

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'local' );

/** Database username */
define( 'DB_USER', 'root' );

/** Database password */
define( 'DB_PASSWORD', 'root' );

/** Database 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 and salts.
 *
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ 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
 */


/**#@-*/

/**
 * 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_';


/* Add any custom values between this line and the "stop editing" line. */



/**
 * 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.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/support/article/debugging-in-wordpress/
 */
if ( ! defined( 'WP_DEBUG' ) ) {
	define( 'WP_DEBUG', false );
}

define( 'WP_ENVIRONMENT_TYPE', 'local' );
/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
	define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

define('AUTH_KEY',         'LD0jrpTHKhzGJKOD8z8V0FeN5qm6a8PJoaF9o7rfD7KF/fJQ25zONVoaoUQGrJc6WWW5gIA68LsUm03kKP8jKA==');
define('SECURE_AUTH_KEY',  'n2iqIaPodV8kg345uKOpslKfppRTblU92zQcgVTc7YhNszIpUk2Ehs7o13nvw4QEf/TtfCAgqljiGiDVPUAL4Q==');
define('LOGGED_IN_KEY',    'Xuz/gQynehHg5LF8STZQzFe1RcF3VFXZgTebizIloEt/0za29T3QB8xP833LUMowiMGMU2E7dkgla2NYflR/5g==');
define('NONCE_KEY',        'AsVueJwGa3ZTYCe3K8pACFn+Pyo9z+pxHo+HTtBqR7fRTsXCjXP8Ccoxf6FLmB14hlNWSiUY6McRegi8HS18vA==');
define('AUTH_SALT',        'R7ip5JGIOvuNJQiA8JW1YgJED+gg9jksc7ugiHrX/Q9z6aM10mptR6o6pQ+/81mmcZFpbSN9s+3J3kh1dHrObw==');
define('SECURE_AUTH_SALT', '/P+ek8f6T2GAXUz2lRa4bMcjehLgYihpISbXX3ZfnkzG6Tn9AvezvFAyweJqM87c9m3fjynH0rGIK32TiGlfHA==');
define('LOGGED_IN_SALT',   'zfLfr2RGslsgubWeFzOEODaWCcFbjmvfTfn5oWeAv/2Ceh7zDbofFH58cuqnzzJNyjYnb1M7/PfOJosjXwJWDg==');
define('NONCE_SALT',       'NHOriWR7z8874qpGaV5NDLlp/n5tIHUEBloQAQQvntd8EObsvU5r5O56wn3afq/5dV8ZqdCpjZxuAU1rcxABbg==');

Fixed format

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the web site, you can copy this file to "wp-config.php"
 * and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * Database settings
 * * Secret keys
 * * Database table prefix
 * * Localized language
 * * ABSPATH
 *
 * @link https://wordpress.org/support/article/editing-wp-config-php/
 *
 * @package WordPress
 */

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'local' );

/** Database username */
define( 'DB_USER', 'root' );

/** Database password */
define( 'DB_PASSWORD', 'root' );

/** Database 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 and salts.
 *
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ 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
 */


/**#@-*/

/**
 * 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_';


/* Add any custom values between this line and the "stop editing" line. */

define('AUTH_KEY',         'LD0jrpTHKhzGJKOD8z8V0FeN5qm6a8PJoaF9o7rfD7KF/fJQ25zONVoaoUQGrJc6WWW5gIA68LsUm03kKP8jKA==');
define('SECURE_AUTH_KEY',  'n2iqIaPodV8kg345uKOpslKfppRTblU92zQcgVTc7YhNszIpUk2Ehs7o13nvw4QEf/TtfCAgqljiGiDVPUAL4Q==');
define('LOGGED_IN_KEY',    'Xuz/gQynehHg5LF8STZQzFe1RcF3VFXZgTebizIloEt/0za29T3QB8xP833LUMowiMGMU2E7dkgla2NYflR/5g==');
define('NONCE_KEY',        'AsVueJwGa3ZTYCe3K8pACFn+Pyo9z+pxHo+HTtBqR7fRTsXCjXP8Ccoxf6FLmB14hlNWSiUY6McRegi8HS18vA==');
define('AUTH_SALT',        'R7ip5JGIOvuNJQiA8JW1YgJED+gg9jksc7ugiHrX/Q9z6aM10mptR6o6pQ+/81mmcZFpbSN9s+3J3kh1dHrObw==');
define('SECURE_AUTH_SALT', '/P+ek8f6T2GAXUz2lRa4bMcjehLgYihpISbXX3ZfnkzG6Tn9AvezvFAyweJqM87c9m3fjynH0rGIK32TiGlfHA==');
define('LOGGED_IN_SALT',   'zfLfr2RGslsgubWeFzOEODaWCcFbjmvfTfn5oWeAv/2Ceh7zDbofFH58cuqnzzJNyjYnb1M7/PfOJosjXwJWDg==');
define('NONCE_SALT',       'NHOriWR7z8874qpGaV5NDLlp/n5tIHUEBloQAQQvntd8EObsvU5r5O56wn3afq/5dV8ZqdCpjZxuAU1rcxABbg==');

/**
 * 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.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/support/article/debugging-in-wordpress/
 */
if ( ! defined( 'WP_DEBUG' ) ) {
	define( 'WP_DEBUG', false );
}

define( 'WP_ENVIRONMENT_TYPE', 'local' );
/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
	define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';


Bug Summary

I updated local to 7.0.1 but cannot login as admin.

Environment Info

windows 10 64bit

Hello @dominicusheru -

Can you please provide more information so we can support you?

Thank you!

I’ve merged your topic here as this appears to be related + a workaround has been suggested above.

Sam

Issue Summary

After updating to local wp 7.0.1 yesterday, I cannot login into the admin dashboards of the newly created sites via the wp-admin/wp-login urls. After clicking the Log In button, the site just redirects to the login page again, and resets the username/password input fields.

Troubleshooting Questions

  • This happens for all new created sites in Local.

  • I am able to create new, plain WordPress sites in Local and access them in a Browser, but cannot login to the admin dashboard.

Replication

Create a new site (environment does not matter), click the WP Admin button, or navigate to /wp-admin, input the credentials, click the Log In button.

System Details

2 Likes

Hey there. I believe there’s a solution to this here (URL) But I have the same issue and I don’t understand the solution. Maybe it helps you or maybe anyone can place the edited wp-config.php file here for download? I have no idea how to do this and I don’t know programming.

Hello @mirko and @Tamsn -

If you downgrade back to the previous version of Local do you still see the same behavior?

Sam

@mirko this happened to me right after I upgraded to 7.0.1! :face_with_symbols_over_mouth: I was still able to log into sites created with older versions of Local.

Somewhat relieved that I’m not the only one dealing with this. I hope it relieves you to know downgrading to 6.7.2 has worked for me!

Thanks for the tip, @sambrockway!

2 Likes

Thanks for the quick reply. I downgraded to 6.7.2 and deleted and recreated my new site in this version. It didn’t work just with the downgrade, but with a new site that’s been created in the old version, it now it appears to be working. Thanks.

1 Like

@Tamsn, thank you for the link, I have found the sam quick fix in the meantime.

The 7.0.1 places the generated keys at the bottom of the wp.config file. You just need to move them up:

@sambrockway, I tried downgrading, but as @Tamsn said, the sites created with 7.0.1 have the problem:

Anyway, hope you guys resolve this in the upcoming update, as it would be bothersome to move the keys after every new site.

2 Likes

After installation Local 7.0.1 update (Windows 10) I couldn’t Log Into WP Dash board.
All the old WP sites work fine and I can log in
All frashly created WP sites - I can’t Log In.
The system (LocalWP) just doesn’t accept my Log/Pass.
I deleted LocalWP via Revo Unistaller, made a frash installation of Local - the same problem.
I can create WP sites but I can’t Log into WP Dash Boards.
As I can see many people have the same problem after 7.0.1 update
I didn’t understand what kind of sollution was suggested to use.
What should I do?

I agree that the solution in another thread was anything but clear. But all they did was move a bunch of lines from the end of wp-config.php to where I have referenced in the photo

It would be much better to create detailed instructions for everyone - what exactly we should do step by step.

I tried to reinstall version 7.0.1 of Local WP several times, but the problem was repeated every time.
I couldn’t log in to the admin panels of newly created sites.

Then I installed the old version - Local-6.7.0-windows.
After that, everything was fine, just like in the good old days.

The speed in the browser seems to have become slower, but otherwise everything is fine.

Conclusion: Updates are more harmful than useful.
Why do we need them at all?

2 Likes

Hello everyone!

I’ve merged all related topics into this thread to keep everything in one place.

This has been flagged as a bug and the Local engineering team is aware of the issue.

A quick word of caution - before changing wp-config.php we recommend making a backup of the original version of that file & perhaps one step further create a backup of your entire Local site as well.

Thank you,

Sam

3 Likes

Sorry to those affected by this! The Local team is looking into a bug fix.

For now, those starting new sites on Windows with Local 7.0.0 or 7.0.1 who are unable to log in and who don’t want to downgrade or edit their wp-config.php as described above can try enabling one-click admin to work around the issue:

  1. Turn on “One-click admin” in your Local site Overview page and choose a user.
  2. Click the “WP Admin” button to log in.

We’ll update this thread when a new version of Local is available with a fix.

4 Likes

Strange, how did this get past QA and beta testers?

1 Like

Thank you! you solved my problem.

Hello,

I have an account on Local By Flywheel and I’m trying to create a new site. Strangely, I have a bug when connecting to the Wordpress page. When I come to add my login and click login, the form fields become empty again and I can’t log in.

Could you please help me?

Thank you

Issue Summary

One or two sentence summary of the issue.

Troubleshooting Questions

  • Does this happen for all sites in Local, or just one in particular?

This happens to any new site I create, however I can still log into the site that I had created on local prior to this happening.

  • Are you able to create a new, plain WordPress site in Local and access it in a Browser?

I can create a new one, but when attempting to login via the wordpress dashboard admin, It does not log in and instead clears the characters I just entered from both the username and password section as if the page was refreshed.

Replication

While in Local, I click on the wordpress admin button and attempt to log in, however it does not work.

System Details

  • Which version of Local is being used?

Version 7.0.1+6387

  • What Operating System (OS) and OS version is being used?
    Windows 11

  • Attach the Local Log.

local-logs.zip (7.1 KB)

Security Reminder

Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

2 Likes

I was having the same issue. I reset my password moe than once, created a new admin user and cleared my cach but still no luck.

Here is what worked for me:
From the localwp app:
1- Enable one click admin on the overview tab and select the admin name.
2- Click on the wp admin button
I got connected to the dashbaord.
I hope this helps

This works for me but what is the underlying issue? I should still be able to enter the site with manual credentials :frowning: