• Hello, my website has an error saying “Error establishing a database connection“. I have checked everything that I could including checking database connection setting values.

    Here are the error messages that I have.

    [17-Feb-2023 06:24:22 UTC] PHP Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /var/www/html/wp-includes/class-wpdb.php on line 1775
    [17-Feb-2023 06:24:22 UTC] PHP Deprecated: Function create_function() is deprecated in /var/www/html/wp-includes/plugin.php on line 484
    [17-Feb-2023 06:24:22 UTC] PHP Warning: chmod(): No such file or directory in /var/www/html/wp-includes/plugin.php(484) : runtime-created function on line 1

    Thank you in advance!

    Best regards,
    Esther

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The deprecated message indicates that you are using a plugin or theme that does not match the PHP version you are currently using. Do you have everything up to date? Has the PHP version been changed to 8.0 without installing the necessary updates?

    Thread Starter doflab

    (@doflab)

    @threadi Thanks for your reply!

    The PHP version that I am currently using is 7.2 version. I do not want to upgrade the current PHP version. Is there any other option that I could try other than updating the PHP version?

    There have been no updates for PHP 7.2 for years. Continuing to work with it means a risk for you and your project.

    The first message indicates to me that you have configured a strange database connection in wp-config.php. Are you working with a socket here? Obviously PHP can’t find it. This is more a problem with the hosting than with WordPress.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error establishing a database connection’ is closed to new replies.