無法將文件從GCE(Compute Engine)上傳到PHP中的GCS我嘗試使用PHP中的gsutil將文件從GCE(Google Compute Engine)上傳到GCS(Google Cloud Storage)。使用gsutil
**exec("gsutil -m cp xxx.jpg gs://a56/upload", $output, $return_var);**
我可以上傳使用命令文件(#gsutil -m CP XXX.JPG GS:// A56 /上傳), 但它不能在PHP工作。
apache錯誤日誌顯示權限問題。
**OSError: [Errno 13] Permission denied: '/var/www/.config'**
我試圖通過「搭配chmod 777的/ var/www」的避免這個問題,並添加用戶「WWW的數據」到「根」組,但我仍然有權限的問題。
**AccessDeniedException: 403 Insufficient Permission
**CommandException: 1 files/objects could not be transferred.
我該如何解決這個問題? 還是有更好的方法來上傳文件?