Search and Replace
[resolved] PHP 5.5 incompatibility (6 posts)

  1. techsurgeons
    Posted 1 year ago #

    We've updated our server to PHP 5.5 and S&R stopped working

    Doing a quick scan through the logs, I see entries like this:

    HP message: PHP Warning: mysql_real_escape_string(): A link to the server could not be established in /home/www/X/htdocs/wp-content/plugins/search-and-replace/search-and-replace.php on line 514, referer: http://X.com/wp-admin/tools.php?page=search-and-replace/search-and-replace.php

    Looking through the code, it seems the now deprecated MySQL extension is being used by mysql_fetch_assoc() and others.

    See: http://www.php.net/manual/en/function.mysql-fetch-assoc.php


    This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:



  2. RonG
    Posted 1 year ago #

    Try this version and let me know if it works for you: http://vnetworx.net/search-and-replace-test-version.zip

    You need to put the file into your existing search-and-replace plugin folder.

  3. Pete
    Posted 1 year ago #


    I was getting the errors below in the WordPress debug.log. I see your new code doesn't use mysql_query. The updated file you linked to is working

    [09-Jul-2014 19:26:29 UTC] PHP Warning: mysql_query(): Access denied for user 'www-data'@'localhost' (using password: NO) in /var/www/html/wp-content/plugins/search-and-replace/search-and-replace.php on line 484

    [09-Jul-2014 19:26:29 UTC] PHP Warning: mysql_query(): A link to the server could not be established in /var/www/html/wp-content/plugins/search-and-replace/search-and-replace.php on line 484

    I'm on WordPress 3.9.1

    PHP Version 5.5.9-1ubuntu4.2

    When will you push an update to WordPress.org?

  4. RonG
    Posted 1 year ago #

    Soon, I hope. I have to make a few changes in the translations, contact the present maintainer, and I really don't know how the developer uploading stuff works.

  5. RonG
    Posted 1 year ago #

    Ok, the plugin author (Frank) will be away for a month, so I tried to fork the plugin, but there's 116 plugins waiting review.

    You can download the new plugin directly from my site for now.

  6. Frank Bueltge
    Plugin Author

    Posted 1 year ago #

    The fixes from RonG are now inside the new version. THANKS to RonG

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic