5
ok I found the fix if you are getting this error.
I had to go and enable MySQL in the php.ini file.
navigate to the php.ini.default file by typing cd /etc.
In its current state, php.ini.default does nothing; php launches with its default values. In order for php to read the ini file, it must be renamed to php.ini. We will do a copy to retain the default file, just in case:
sudo cp php.ini.default php.ini
sudo pico php.ini. Press Control-W and search for mysql.default_socket, and make it look like this:
mysql.default_socket = /tmp/mysql.sock
Save the changes by pressing hen pressing Control-X, then press Y, then press Enter.
Doing this fixed the issue.