• Hello.

    I am not an advanced developer. I am novice with limited knowledge, building theme based WordPress sites with visual composer plugins. I can access Cpanel and navigate through there and can follow instructions reasonably well to locate certain files and update the code within them. I am very passionate about learning a lot more and would be eternally grateful if the community can help guide me through a solution to this issue. I may need slightly more step by step than the advanced developer, but I am savvy and can follow instructions pretty quickly.

    Intro:

    I have the following websites built with WordPress (oldest one built 5/6 years ago, latest one built 1-2 months ago. All of these websites are hosted with TSOHost. Some time ago, TSOHost retired the gridhost server these sites were hosted on and migrated them to their new server. Since they did this, it appears that all my sites sit within one top level root folder (i’m not sure this should have been done as now an issue has occured with all of my websites.

    Domains effected:

    [ Many redundant domains removed ]

    Issue:

    As you can see, all websites (apart from shrewsburyflooring.co.uk) display the following message – Error establishing a database connection. I spoke to my hosts (TSOHost) who have helped identify the issue, however cannot assist me in correcting it.

    Hosts response: I see that only the websites that are connecting to this specific database are
    encountering this issue. define(‘DB_NAME’, ‘rainband_vbuo’);

    You have fatal errors on your files. PHP Fatal error: Uncaught Error: Call to undefined
    function mysql_connect() in
    /home/ewazkhk3oocp/public_html/wp-includes/class-wpdb.php:1810

    mysql()_connect does not establish the connection

    This error occurs because mysql_connect() is an old PHP function that was removed in PHP 7.0. Your site is likely trying to use this deprecated function, which means it’s either running outdated code, or the PHP version you’re using is too new for the code.

    Basically every website set-up under public_html , any settings done in public_html will
    affect the entire server.

    This is coming from the website files which are using old PHP functions and are not
    updated.

    What fixes I have tried already:

    • Updated server php to PHP 8
    • Reset database password and matched it in config file

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Your host has already recognized it correctly, but his conclusion has not been thought through to the end. You are obviously using an ancient WordPress installation that is not compatible with the PHP version that your hosting is currently using.

    I suspect that the websites were previously operated with PHP 5.6 – there were still the mysql functions for the database connection. Now PHP 7.4 or newer is probably in use, but your WordPress is not compatible with it.

    My recommendation:
    First make a backup of everything. Files and databases.
    Then do a manual update of WordPress to the latest version (currently 6.6.2), see: https://www.ads-software.com/documentation/article/updating-wordpress/#manual-update
    After that, you should see more than just the database connection error message again. But now you probably also have to update the plugins and themes you use so that the websites are finally accessible again.

    Note that when doing this, you may also come across plugins for which there is no update and which are therefore not compatible with the newer PHP. You would have to delete these and find a suitable replacement if you still need their functions.

    The alternative to my above recommendation would be to find a hoster to whom you can move your websites. However, this would have to provide ancient PHP versions, which no serious hoster should do anymore. Therefore, the method described above is the only practical one for you.

    If you need help with this, you may be able to find someone here: https://jobs.wordpress.net/

    Thread Starter mikej851

    (@mikej851)

    @threadi – thank you. I had come across a similar a solution, I will try my best to execute based on the instructions. Excuse my lack of knowledge here, but the latest site I built was only 2 months old. I would have thought, through the one click install in my hosting account, it would have installed the latest version of WordPress? Likewise, another site in the list was only built last year. If this was just one website, built many years ago, I could understand. Am I missing something here you think?

    Thread Starter mikej851

    (@mikej851)

    Hi @threadi – dont know how or why – but all of my websites apart from one has come back! I haven’t even tried your recommendation yet. Possibly the things I tried yesterday have bought the sites back online? – Anyhow, I still have one issue with rainbandirrigation.co.uk – the error message there now is There has been a critical error on this website. Any idea how I can find out what this particular issue could be?

    This does not happen by magic. Your host may have changed something. You can only find out more details there.

    The reason for the critical error should be visible in the error log. You can find it in your hosting area. If necessary, the support of your hosting can help you.

    Alternatively, you could also enable debugging in WordPress. How to do this is described here: https://www.ads-software.com/support/article/debugging-in-wordpress/ – also here the support of your hosting can help you if necessary to edit the file accordingly.

    In both cases you should be able to see what the cause is in the logfile.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.