Php 上载时出现Google云存储错误

Php 上载时出现Google云存储错误,php,google-cloud-storage,Php,Google Cloud Storage,我在上载时遇到以下错误: 致命错误:未捕获的Google\Cloud\Core\Exception\NotFoundException:{“错误”:{“错误”:[{“域”:“全局”,“原因”:“未找到”,“消息”:“未找到”}],“代码”:404,“消息”:“未找到”}}位于/www/Google/vendor/Google/Cloud Core/RequestWrapper.php:257堆栈跟踪:#0/www/Google/vendor/Google/Google/Google/Cloud

我在上载时遇到以下错误:

致命错误:未捕获的Google\Cloud\Core\Exception\NotFoundException:{“错误”:{“错误”:[{“域”:“全局”,“原因”:“未找到”,“消息”:“未找到”}],“代码”:404,“消息”:“未找到”}}位于/www/Google/vendor/Google/Cloud Core/RequestWrapper.php:257堆栈跟踪:#0/www/Google/vendor/Google/Google/Google/Cloud Core/RequestWrapper.php(162):Google\Cloud\Core\RequestWrapper->converttoogleexception(Object(GuzzleHttp\Exception\ClientException))#1/www/Google/vendor/Google/Cloud-Core/Upload/MultipartUploader.php(64):Google\Cloud\Core\RequestWrapper->send(Object(GuzzleHttp\Psr7\Request),Array)#2/www/Google/vendoor/Google/vendour/Cloud/storage/Bucket.php(268):Google\Cloud\Core\Upload\MultipartUploader->Upload()#3/www/Google/index.php(20):Google\Cloud\Storage\Bucket->Upload(Resource id#46)#4{main}在第257行的/www/Google/vendor/Google/Cloud Core/RequestWrapper.php中抛出


如果projectd/bucket/file都存在,那么应该这样做

使用Google\Cloud\Storage\StorageClient;
$storage=新的StorageClient([
“projectId”=>“YourProjectId”
]);
$bucket=$storage->bucket('mybucker');
$bucket->upload(
fopen('/test.txt',r')
);

mybucker
是打字错误吗?
# Includes the autoloader for libraries installed with composer
require __DIR__ . '/vendor/autoload.php';

# Imports the Google Cloud client library
use Google\Cloud\Storage\StorageClient;

# Your Google Cloud Platform project ID
$projectId = 'projectId ';

$storage = new StorageClient([
    'projectId' => $projectId,
    'keyFilePath' =>'./key.json'
]);

$bucket = $storage->bucket('mybucker');

// Upload a file to the bucket.
$file = fopen('./test.txt', 'r');