Forums

WordPress Move
[resolved] PHP Catchable fatal error: Object of class stdClass could not be converted (12 posts)

  1. Gwyneth Llewelyn
    Member
    Posted 8 months ago #

    Hi! On a WordPress site running PHP 5.2.17, the following error, related to the WordPress Move plugin, pops up either on Simple or Advanced modes:

    PHP Catchable fatal error: Object of class stdClass could not be converted to string in /var/www/html/wp-content/plugins/wordpress-move/libs/functions-database-backup.php on line 198, referer: [...]

    This is traceable to the call

    $option = str_replace( $find, $replace, $option );

    after explicitly checking that $option is not an array. PHP 5.2 (and very likely 5.3 as well!) has some bugs in correctly parsing the line in this situation.

    Strangely, when changing line 198 to

    $option = str_replace( $find,
                            $replace,
                            $option );

    (i.e. putting things on separate lines!) the error disappears...

    Now my next step is to figure out why the process never terminates :)

    http://wordpress.org/extend/plugins/wordpress-move/

  2. Mert Yazicioglu
    Member
    Posted 8 months ago #

    Could you please try changing line 197 which is:

    else

    with

    elseif ( ! is_object( $option ) )

    without splitting str_replace into seperate lines?

  3. Dana DiTomaso
    Member
    Posted 8 months ago #

    I'm not OP, but had the same issue. That code change did fix the error for me, but the files didn't seem to actually transfer.

  4. Dana DiTomaso
    Member
    Posted 8 months ago #

    Update - manually moved the backup zip and sql files from the old server to the new, restored beautifully otherwise.

  5. Mert Yazicioglu
    Member
    Posted 8 months ago #

    Change Domain Name mode does not transfer your files if that's what you did. You need to use either Simple or Advanced Migration for that.

    I'm glad this solved the problem :)

  6. Dana DiTomaso
    Member
    Posted 8 months ago #

    I was using Advanced Migration and it didn't transfer the files.

  7. Mert Yazicioglu
    Member
    Posted 8 months ago #

    Were there any errors or did it say "The migration has been completed successfully"?

    FTP transfers are actually handled by PemFTP, a third party library that comes with WordPress by default.

  8. Dana DiTomaso
    Member
    Posted 8 months ago #

    No errors at all, said it was successful, but went far too quickly for the file transfers to have actually happened.

  9. Mert Yazicioglu
    Member
    Posted 8 months ago #

    Than something exceptional must have happened during the operation. Plugin relies on what is returned by PemFTP, so it is possible that a rare situation like the one you experienced may cause PemFTP to think it was a success. Will have a look at that, thanks! :)

  10. Dana DiTomaso
    Member
    Posted 8 months ago #

    Okay - I'll open a new thread if it happens the next time I use it, thanks!

  11. Gwyneth Llewelyn
    Member
    Posted 8 months ago #

    @Mert, doing the proposed changes definitely made the error go away.

    Now my biggest problem is that there are over 1 GByte in files, and thus the migration process never terminates, even letting it run for several hours hehe :-)

    And I did increase the script timeouts :)

  12. Mert Yazicioglu
    Member
    Posted 8 months ago #

    Technically speaking, WordPress Move should work on all WordPress installations regardless of their size. Handling lots of files might be causing PHP to hang, so could you please try migrating partially using the Advanced Migration and see if it works?

Reply

You must log in to post.

About this Plugin

About this Topic