Replace MySQL modules in Cloudlinux with Native Driver (ND) modules


Written by Dennis Nind

Last published at: June 5th, 2019

Sometimes standard MySQL modules(mysqli,mysql,pdo_mysql) can work incorrectly and it's recommended to switch this modules to ND(native driver - nd_mysqli,mysqlnd,nd_pdo_mysql).

You can try to use a script like this  to enable those modules globally:

selectorctl --list-users --version=7.0 | sed -e 's/,/\n/g' | sed 's/^/selectorctl  --disable-user-extensions=mysqli,mysql,pdo_mysql --version=7.0 --user=/' | sh
selectorctl --list-users --version=7.0 | sed -e 's/,/\n/g' | sed 's/^/selectorctl --enable-user-extensions=nd_mysqli,mysqlnd,nd_pdo_mysql --version=7.0 --user=/' | sh

The following commands will disable standard modules and will enable ND modules for all users that are using  alt-php70.