0

I setup a LAMP server on my new laptop and downloaded a website from the live server to my local machine. Everything appears to be working, but I can't login, when I go to http://localhost/mysite/wp-login.php and enter the correct details, it just redirects back to wp-login.php without actually logging in.

I'm using a new WordPress install on my local machine so it's a new wp-config file.

I made sure the site URL is correct in wp_options, I made sure the username and password is correct, I tried downloading the .htaccess file from the live server, I tried defining WP_HOME and WP_SITEURL in the wp-config.php file. I tried changing browser to Chrome (which has no extensions and no cookies or history, I never use Chrome).

I tried adding:

define('FORCE_SSL_ADMIN', false);

to wp-config.php. I tried deleting all plugins.

I don't know what else to try, or how to diagnose the problem.

1 Answer 1

1

So I changed this in the wp-config.php file:

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' );
define( 'AUTH_SALT',        'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT',   'put your unique phrase here' );
define( 'NONCE_SALT',       'put your unique phrase here' );

And added all the hashes from the wp-config.php file on the live server and now it works.

1
  • Ah. Thanks for adding the answer. It would be very helpful for people searching for the same problem if you update your question to note that you didn't use the same wp-config.php from your live site, or how you altered it before trying to run your local site. (Usually it would be expected people would try the whole wp-config.php from the source site)
    – mozboz
    Jul 15, 2020 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.