• I am getting the following error, on a default WordPress install using twentsixteen theme.

    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home//public_html/wp-includes/wp-db.php on line 1520
    
    Warning: Cannot modify header information - headers already sent by (output started at /home//public_html/wp-includes/wp-db.php:1520) in /home//public_html/wp-content/plugins/wordpress-seo/admin/class-admin-init.php on line 84
    
    Warning: Cannot modify header information - headers already sent by (output started at /home//public_html/wp-includes/wp-db.php:1520) in /home//public_html/wp-includes/pluggable.php on line 1171

    The hosting company is saying the following..

    If you wish to continue to use deprecated code under PHP 5.5, I understand that it’s possible to suppress deprecation errors by setting error_reporting in php.ini to exclude E_DEPRECATED:

    error_reporting = E_ALL ^ E_DEPRECATED

    Alternatively, I can arrange for your hosting to run on PHP 5.4, which is the latest version where MySQL is not deprecated / removed (PHP 7).

    With either option, you will not be able to upgrade PHP to a more recent version, as MySQL has been removed from PHP 7 and more recent.

    Is there anything i’m doing wrong or is it a hosting issue?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Can you install the php extension to use mysqli? I think wordpress will use mysqli if available.

    Thread Starter jezthomp

    (@jezthomp)

    Hello Fabio.

    The hosting says the following…

    The PHP extension MySQL is installed. The deprecated error message is generated by PHP 5.5. It is warning you that despite the fact that MySQL is supported, it is not recommended, and may become obsolete.

    We can disable the deprecated error messages, but it will not change the fact that MySQL is deprecated in PHP 5.5.

    So PHP extension is installed, surely its more than just turning off the errors, i’ll ask them to do that though.

    You have a couple of different warning/error messages there.

    Warning: Cannot modify header information - headers already sent by (output started at /home//public_html/wp-includes/wp-db.php:1520) in /home//public_html/wp-content/plugins/wordpress-seo/admin/class-admin-init.php on line 84

    That may be related to the wordpress-seo plugin. Disable it and see if the error changes or goes away. Make sure you have the latest version.

    Thread Starter jezthomp

    (@jezthomp)

    Removing all the plugins just leaves this..

    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home//public_html/wp-includes/wp-db.php on line 1520
    
    Warning: Cannot modify header information - headers already sent by (output started at /home//public_html/wp-includes/wp-db.php:1520) in /home//public_html/wp-includes/pluggable.php on line 1171

    I think its a hosting error surely?

    I am having this same exact issue:

    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/gcnorthhampton/public_html/wp-includes/wp-db.php on line 1482
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/gcnorthhampton/public_html/wp-includes/wp-db.php:1482) in /home/gcnorthhampton/public_html/wp-includes/pluggable.php on line 1207

    I am interested to know if you find a solution!

    Same issue

    and only one one site even though in the same server I have different wordpress installation.

    in debug mode on
    all page I have

    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/controlec/public_html/wp-includes/wp-db.php on line 1520

    /wp-admin I get

    Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/controlec/public_html/wp-includes/wp-db.php on line 1520
    
    Warning: Cannot modify header information - headers already sent by (output started at /home/controlec/public_html/wp-includes/wp-db.php:1520) in /home/controlec/public_html/wp-includes/pluggable.php on line 1171

    so My server is in PHP 7
    and this is out Security probleme that the wordpress core should update

    Be Dark

    (@b_dark)

    Same here with wp mu/subdomain 4.5.2 & php 5.6.21:

    [20-May-2016 19:58:35 UTC] PHP Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home//public_html/wp-includes/wp-db.php on line 1520

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Deprecated: mysql_connect(): / Cannot modify header ??’ is closed to new replies.