Hey there, I got the same issue.
Problem was in this file /etc/cl.selector/defaults.cfg
The modules lines for a reason didn't contains any of the "mysql' extensions.
Also, I had to run selectorctl "--enable-user-extensions" command on all users with the correct version and extensions.
Was not a good day.
I don't think that was the same issue for me. All sites were fine before I ran the /usr/bin/switch_mod_lsapi --setup
script and converting native apache to use lsapi with... switch_mod_lsapi --build-native-lsphp.
It was only after this that the problem occurred.
I think the issue is related to how lsapi determines the MySQL socket. I have read that in some cases it seems using 127.0.0.1 instead of localhost in the config for your application will resolve this. I didn't have time to test it because I was in a panic to switch everything back again.
In my.cnf I have socket=/var/lib/mysql/mysql.sock
In the php.ini files generated by alt-php the mysql and mysqli socket directives are empty, meaning the defaults are in place, but the default is /var/lib/mysql/mysql.sock anyway - so that shouldn't be a problem
I notice there is a symlink mysql.sock in /tmp pointing also to /var/lib/mysql/mysql.sock
The /etc/hosts file is correctly configured
Still no idea really.
Testing again...
I ran...
/usr/bin/switch_mod_lsapi --setup
/usr/bin/switch_mod_lsapi --enable-global
I decided not to run...
switch_mod_lsapi --build-native-lsphp
And everything seems fine. Most of our users are running alt-php versions and their sites test out OK.
So in this case it would seem running the switch_mod_lsapi --build-native-lsphp script was the issue. Rebuilding Apache (EasyApache3) with native lsphp support seems to break Mysql connections from PHP. I would guess it is socket related as I mentioned above - but I'm not going to test that again!
Will be switching to EA4 soon anyway so I hope this will not be a problem when we do.