then still in SSH change the ownership to the normal owner of the domain with
chown [user] mysql
Now open up the conf directory to the same user with
chown [user] conf
Go to your control panel and create these two files
1. a file in conf called vhost.conf (content below) and
2. a file in mysql called mysql.php (content below)
Finally, either in SSH Restart the server with
/usr/local/psa/admin/bin/websrvmng -a -v
or you can do it from control panel.
content of vhost.conf (where x is the domain)
php_admin_value open_basedir "/var/www/vhosts/x/httpdocs:/tmp:/var/www/vhosts/x/mysql:"
content of mysql.php
THIS IS THE MASTER DATABASE CONNECTION FILE
IT SHOULD BE STORED ABOVE THE ROOT DIRECTORY IN MYSQL
AND SHOULD BE USED FOR ALL MYSQL CONNECTIONS
mysql_connect("localhost", "[username]", "[password]") or die (mysql_error());
mysql_select_db("[database_name]") or die(mysql_error());
To connect to the database add this in the relevant php scripts
Hope that helps someone save the time it took me to work it out...