如何确定服务帐户路径的位置?

I'm trying to authenticate in the code, per https://github.com/GoogleCloudPlatform/php-docs-samples/blob/master/auth/src/auth_cloud_explicit.php , but I don't know what to pass as the $serviceAccountPath. I copied the private .json file into the root of my app folder. What do I need to use here?

function auth_cloud_explicit($projectId, $serviceAccountPath)
{
    # Explicitly use service account credentials by specifying the private key
    # file.
    $config = [
        'keyFilePath' => $serviceAccountPath,
        'projectId' => $projectId,
    ];
    $storage = new StorageClient($config);
    # Make an authenticated API request (listing storage buckets)
    foreach ($storage->buckets() as $bucket) {
        printf('Bucket: %s' . PHP_EOL, $bucket->name());
    }
}

I think $serviceAccountPath should be contain the local path to your json configuration file (downloaded from Google console)

Considering that you’ve already copied your “private.json” file to the root of the application directory. You should take into account that the local path that you provide for the $serviceAccountPath should always be relative to the that of the app file you wish to navigate to. For instance you could use “./private.json” if the file is in the root directory of your app. What this mean is when you deploy your application on Google Cloud Platform all paths that you had provided in your code that point to your local drives(c://,F://,etc) will no longer work.