WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 2 deprecated errors in 3.7.1 (15 posts)

  1. klampl
    Member
    Posted 5 months ago #

    I get the following debug errors:
    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in *\wordpress\blogs\wp-includes\wp-db.php on line 1142 Notice: wpdb::escape is deprecated since version 3.6! Use wpdb::prepare() or esc_sql() instead. in *\wordpress\blogs\wp-includes\functions.php on line 2924
    * = path to IIS wwwroot folder

    Is there a fix for either?

    Thanks,
    KLampl

  2. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    You have a bad theme or plugin that needs to be updated. Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the default theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

  3. klampl
    Member
    Posted 5 months ago #

    I got rid of the second one by removing wordpress-mu-domain-mapping.
    the first on is still there.
    I removed all plugins and I also removed all themes but one reinstalled a new theme and then removed the last on to be removed. I then re-installed the first theme (twenty thirteen).

    out of ideas on my side.

  4. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    I specifically suggested that you switch to the 2013 theme. This is a well-known plugin/theme issue - not a WordPress core one.

  5. klampl
    Member
    Posted 5 months ago #

    "I then re-installed the first theme (twenty thirteen)."

    I meant I re-downloded the default 2013 then reactivated it for the 2 sites I have. I then deleted all other themes. I now have only 1 theme the 2013 default.

    I have deactivated and removed all plugins as well as resetting the plugins folder with PhpMyAdmin.

    All (1) | Enabled (1)
    1 item « ‹ of 1 › »

    Theme Description
    Select Twenty Thirteen
    Twenty Thirteen
    Network Disable | Edit
    Version 1.1 | By the WordPress team | Visit Theme Site

    I also tried: I network disabled the theme and set each site individually to the 2013 v1.1 theme

    Plugins -
    You do not appear to have any plugins available at this time.

    Where else am I to check?

  6. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    Try re-uploading all files & folders - except the root wp-config.php & .htaccess files and the the wp-content folder - from a fresh download of WordPress. Make sure that you delete the old copies of files & folder before uploading the new ones.

  7. klampl
    Member
    Posted 5 months ago #

    I deleted everything in the wordpress folder and emptied the trash.
    I kept the following files index.php, .htaccess, and web.config from the root. I also kept the files wp-config.php from the blogs folder.
    I downloaded 3.7.1 and extracted the zip into the root folder (wordpress) and renamed the wordpress folder to blogs.

    I put index.php, .htaccess, and web.config into the root folder and wp-config.php into the blogs folder.
    the web.config only holds the information that the network setup said to put in there. index.php only has:
    define('WP_USE_THEMES', true);
    /** Loads the WordPress Environment and Template */
    require( dirname( __FILE__ ) . '/blogs/wp-blog-header.php' );

    and the .htaccess has :
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) blogs/$1 [L]
    RewriteRule ^(.*\.php)$ blogs/$1 [L]
    RewriteRule . index.php [L]

    the wp-config has:
    define('WP_DEBUG', true);
    /******************************** Multisite Network*/
    /*first*/

    define( 'WP_ALLOW_MULTISITE', true);
    /*start network setup */
    $base = realpath(dirname(__FILE__)) . '/';
    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', true);
    define('DOMAIN_CURRENT_SITE', 'wordpress2.ctctel.com');
    /*define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);*/
    /* That's all, stop editing! Happy blogging. */

    /** Absolute path to the WordPress directory. */
    if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');
    /** Sets up WordPress vars and included files. */
    require_once(ABSPATH . 'wp-settings.php');

    the site still has the error: "Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in E:\inetpub\wwwroot\wordpress\blogs\wp-includes\wp-db.php on line 1142"

  8. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    I can only suggest that you contact your hosts about this.

  9. klampl
    Member
    Posted 5 months ago #

    I am the host. this is the only install of wordpress on the server.
    that is why nothing is making sense.

    Thanks for your help though, I appreciate it.

  10. esmi
    Theme Diva & Forum Moderator
    Posted 5 months ago #

    Sorry I couldn't help more. I'm at something of a loss as to how you can still be getting this error. Every time I've seen it previously, it has been due to a theme or plugin that has (to use the technical term) "been doing it wrong" and finally got picked up when WordPress 3.6 was released.

    See http://wordpress.org/support/topic/wordpress-36-rc2-last-minute-wpdbescape-deprecation-is-not-nice?replies=2

  11. Rajesh Soni
    Member
    Posted 5 months ago #

    File: wp-config.php

    define('WP_DEBUG', true);

    change that to

    define('WP_DEBUG', false);
  12. klampl
    Member
    Posted 5 months ago #

    I found this in the wp-db.php
    line 1142:
    if ( WP_DEBUG ) {
    $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
    } else {
    $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
    }

    I am using PHP 5.5.5 which states all calls to mysql_* are depreciated since PHP 5.5.0
    Do you think this is what is causing the error?

  13. jamesvandyke
    Member
    Posted 4 months ago #

    This is an issue with PHP 5.5 and WordPress Core. PHP is pushing a different database connection type PDO and WordPress hasn't adopted it yet due to backwards compatibility issues.

    I think the adoption rate by hosting companies for 5.5 is fairly low. Your best bet is using PHP 5.4 until WordPress updates the database connections.

  14. jamie
    Member
    Posted 4 months ago #

    This is an issue with PHP 5.5 and WordPress Core. PHP is pushing a different database connection type PDO and WordPress hasn't adopted it yet due to backwards compatibility issues.

    yes it only started for me when i did a system update, any word on when it might be adopted ? its only an annoyance on localhost for me at the moment

  15. Nguyên Hùng
    Member
    Posted 4 months ago #

    Yeah ! i see many function depreciate in new wordpress edition, many people tell me that error !

Reply

You must log in to post.

About this Topic