10

First post on here.

I am a developer for the company I work for and we have a word press site that is public (we host it). For this query lets say the url is http://mywordpresssite

We have just copied the site internally to our DEV server so we can perform development on it. The mySQL database has been copied as well and if I browse to the internal URL I can view the page. Lets say the url is http://mywpsite.

The problem comes when I try to access the admin console on the dev site. On the public site I would use http://mywordpresssite/wp-login.php and this works fine. If I use http://mywpsite/wp-login.php I get the following web page.

screenshot of error message

I am not that familiar with word press, does anyone have any tips on how to resolve this or where I should be looking to change files etc.

Thanks

UPDATE

I am still having an issue with this but I am a bit further through identifying the issue.

I enabled error logging on the site and when I try to navigate to the admin page the error log displays the following:

[04-Apr-2017 07:31:22 UTC] PHP Warning: Illegal string offset 'remember' in D:\mywordpressstie\wp-includes\user.php on line 39 [04-Apr-2017 07:31:22 UTC] PHP Warning: Cannot assign an empty string to a string offset in D:\mywordpressstie\wp-includes\user.php on line 39 [04-Apr-2017 07:31:22 UTC] PHP Warning: Illegal string offset 'user_login' in D:\mywordpressstie\wp-includes\user.php on line 54 [04-Apr-2017 07:31:22 UTC] PHP Fatal error: Uncaught Error: Cannot create references to/from string offsets in D:\mywordpressstie\wp-includes\user.php:54 Stack trace:

0 D:\mywordpressstie\wp-login.php(775): wp_signon('', '')

1 {main} thrown in D:\mywordpressstie\wp-includes\user.php on line 54

I have been googling it but my php/wordpress knowledge is limited. I found the following URL link to patch, bit no idea how to use this.

Can anyone help?

3
  • You can check the errors.log to find out more on what caused the error 500.
    – hcheung
    Mar 16 '17 at 13:53
  • where would I find that
    – Silentbob
    Mar 16 '17 at 14:16
  • It usually located at /var/log/ directory. Alternatively, you could edit wp-config.php to turn on wordpress debug setting, take a look at this link.
    – hcheung
    Mar 17 '17 at 0:11
30

I fixed it!!! Woohoo.

Using this link - link to patch

I edited the line it advises and it works fine.

3
  • Worked for me too, on a brand new WP installation (5.1.1).
    – Jos
    Apr 18 '19 at 8:22
  • This worked for us as well. In our case, we were running WordPress 4.x and had just upgraded to PHP 7.2. It turns out our version of WP was not compatible with PHP 7.1+ per the ticket mentioned in that patch link: core.trac.wordpress.org/ticket/37071 . But no issues after making the change manually!
    – sfarbota
    Mar 2 '20 at 23:43
  • worked beautifully on a 4.3.25 installation.
    – Alejo_Blue
    Apr 5 '21 at 16:45
3

There seems to be an issue with the WordPress version.

https://core.trac.wordpress.org/attachment/ticket/37071/fix-wp-login-error.patch

I fixed this by patching the wp-login.php file.

Line 793:
    - $user = wp_signon( '', $secure_cookie );
    + $user = wp_signon( array(), $secure_cookie );
0

If you copy everything from the actual site, you probably need to check the following:

  1. Check wp-config.php to make sure that the host, database credential is consistent to the local database setup;
  2. Make sure the wordpress directories are belong to the correct owner. Try sudo chown -R www-data:, replace www-data with whoever owner that have the access for web page;
  3. Make sure the directories have the correct access permissions, you can find further information here

If you still have problem, edit your post and provide update.

0

It seems that your site migration might have missed some steps. Since you mention that you are able to access the home page that means that you have changed the wp-config.php with your local db details.

Did you update the wp-options table ? The table contains two important rows which specify the site and home URL.

You can find more about Moving Wordpress site : https://codex.wordpress.org/Moving_WordPress. You can cross check to see if you missed any steps while migrating.

If you are using a mac for your local dev site - you find detailed explanation : http://egalo.com/2012/05/15/clone-live-wordpress-to-local-env/

Also please check if you have copied live site's .htaccess over to dev - they might contain some re-write rules - which will not work on dev. You might want to rename the file to see if it is the cause of this problem.

2
  • yes I have updated the wp-options table with the new URL. As far as I can tell from your link I followed the steps correctly
    – Silentbob
    Mar 16 '17 at 14:02
  • Some suggestions : 1) Did you check on the .htaccess file? was it copied form live to dev site ? 2) Also are you able to access all the pages on the dev site or only the home page ? 3) Are all the same plugins active as same as the live site ? If yes, would suggest to deactivate all of them (move the wp-content/plugins content into another folder - would deactivate the plugins) - then check if you can access your wp-admin
    – Sheeba
    Mar 16 '17 at 16:47
0

I got this error after installing wordpress with composer enter image description here

Edited the user.php in \plugin-wordpress\wp\wp-includes\user.php

Changed the following lines from

function wp_signon( $credentials = array(), $secure_cookie = '' ) {
}

to:

This solved the error and a wordpress login form entry shows up.

function wp_signon() {
     $credentials = array(); $secure_cookie = '' ;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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