0

I just deploy the following app. And i receive the error. Please help me to solve this issue.

$instance_name = "mysql:unix_socket=/cloudsql/My_Project_ID:google-cloud-instance";
$c = new mysqli(null, "root", "My_Password", 'My_DB_Name', 0, $instance_name);
if ($c->connect_error) {
    echo $c->connect_error;
    $c = null;
} else {    
    echo "Connected ";
}

And I receive the error in browser like

Unable to find the socket transport "unix" - did you forget to enable it when you configured PHP?

1 Answer 1

0

The socket argument doesn't say anything about a prefix:

$socket_path = "/cloudsql/My_Project_ID:google-cloud-instance";
$c = new mysqli(null, "my-user", "my-password", 'my-db', $socket_path);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.