skip to Main Content

My client wants to upgrade all his websites script from PHP 5.6 to PHP 8 and mysql 5.7.42 to mariadb 10.5. We want to upgrade one by one website. Now the problem is we can choose different PHP version for each domain and subdomain but for the database we don’t have such choices. So, we will have to upgrade mysql 5.7.42 to mariadb 10.5 all at once server wide and so it will affect all websites of my clients on the server. So my question is, what problem we will face if we upgrade mysql 5.7.42 to mariadb 10.5 with PHP 5.6. Will it be compatible? We are using mysql_* functions, so will it work with that? as its not possible for me to update all the websites script together for mysqli_* or pdo changes.

I upgraded one website script to PHP 8 and deployed on development environment on server to test by creating a subdomain, set its PHP version to PHP 8 but server team is saying that we will have to upgrade database too, so I am completely stuck here, please help..

2

Answers


  1. The answer is that there’s no answer to this question. PHP 5.6 hasn’t been supported in many years. It has been unsupported for many years before MariaDB 10.5 was released. PHP developers had no chance to test it and if there are incompatibilities then nobody would backport it to such an old version officially . But there are people who backport changes and the mysql_* extension was updated at least for PHP 8.0 as far as I remember.

    You will be taking chances with such an odd combination. But of course you should test it first before doing it in production. It would be better not to upgrade anything at all. When you start upgrading, start with PHP. PHP tries to retain compatibility with old MySQL versions as much as possible even though it’s no longer supported.

    Login or Signup to reply.
  2. The simple answer is no, those mysql_ functions won’t work, because they no longer exist since PHP 7.0.0. You might be able to find shims to replicate those functions, but since PHP 5.6 is EOL for several years already I’m not sure how well those shims are working / maintained for PHP 8.

    The best advise I could give you is to get a second server with PHP 8 (and keep the current one with PHP 5.6) and migrate sites one at a time.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search