title: PHP - How can I delete a GCP bucket folder and all files/folders within it?
body: <p>I'm trying to delete a folder in a GCP bucket using the gs storage PHP library.</p>
  <p>The folder structure is like so</p>
  <pre><code>-Folder1
  --Folder1.1
  ---File
  ---File
  --Folder1.2
  ---File
  
  -Folder2
  --Folder2.1
  ---File
  ---File
  --Folder2.3
  ---File
  </code></pre>
  <p>Hopefully, that makes sense. If not, I basically just need to delete a folder and all files and folders within it.</p>
  <p>When I do</p>
  <pre><code>$storage-&gt;bucket($_ENV['bucket_name'])-&gt;object('folder1')-&gt;delete();
  </code></pre>
  <p>I just get a 404 &quot;No such object&quot; error. I can't see any additional options to use in the library to delete a folder and its contents.</p>