Basically, when MySQL 4.1 was introduced it changed how passwords were stored by storing them with longer hashes (all passwords are encoded in a hash, the old hashes were 16 bytes; they were updated for security). Some hosts basically "put off" updating old passwords and added new users with new style passwords (which can be done in the server config with "old_passwords=1")
From what I've read it looks like the error can be fixed by the root user setting a new style password on the account, something like:
ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
I'm not sure why it would have worked in PHP5 and doesn't in PHP7, but it seems like an easy enough thing to have checked (worse case it looks like the password will be updated with current style password hashing).