How to Unzip Folders on the Server Using a Simple PHP Script

I have been installing WordPress MU and BuddyPress a lot recently as I test and test and test it for a client’s website.  The uploading of files via ftp has been the biggest consumer of time during this process.

Yesterday, I discovered a simple PHP script that makes installing WPMU, BuddyPress, WordPress, or really anything else a quick and painless process.  All you need is a zipped folder!  Here is the script:

<?php system('unzip FILENAME.zip'); ?>

Simply:

  1. Create a file called unzip.php on your server.
  2. Copy-and-paste the above line of code into the file. Make sure to update “filename.zip” to whatever your file path is.
  3. Open a browser and point it to http://YOURDOMAIN.com/unzip.php (make sure to change “yourdomain.com” to your domain).

That’s it!

Posted in ,

7 Comments

  1. Paul Alvares on March 22, 2010 at 8:31 pm

    Champ! it works great =]



  2. RB on May 25, 2010 at 1:26 pm

    You are fantastic!!! Saved me so much time after spending a couple of hours trying to figure out(I’m new to this)…thank you! (O:



  3. be on September 18, 2010 at 6:23 am

    Warning: system() has been disabled for security reasons…

    it doesn’t work.



    • Toby on September 28, 2010 at 9:22 am

      That is an issue with your hosting provider.



  4. raoul on August 19, 2011 at 8:54 am

    hm.. no luck. Script runs fine. Just no result.



  5. toby on August 30, 2011 at 12:17 pm

    @raoul and @be – The issue is likely your server setup. Contact your hosting provider and ask them to support the function listed above.



  6. Vasu on December 22, 2011 at 6:00 am

    Here’s an alternate method:

    $zip = new ZipArchive;
      $zipped = $zip->open('test.zip');
      if ( $zipped ) {
      $zip->extractTo(dirname(__FILE__).'test');
      $zip->close();
    }
    


RSS From Toby’s Blog

  • WordPress Maintenance Checklist: Keep Your Site Running Smoothly
    Discover the essential tasks for effective WordPress maintenance and ensure your website runs smoothly and securely with our comprehensive guide.
  • Why We Don’t Automate Our WordPress Hosting Business
    There are some great platforms out there to automate your website hosting biz: But we don’t use any of them. Here’s why: Hosting companies only get worse over time. Over the years, I’ve hosted websites on a bunch of platforms: All of these hosting companies share one thing in common: Over time, they all got…
  • Fortify Your WordPress Site: Essential Security Steps
    Securing your WordPress site is a critical component of maintaining your online presence and safeguarding your data. Security is no longer a luxury, it has become a necessity in today’s digital world, where threats are lurking at every corner. This piece dives deep into WordPress security basics, giving you a comprehensive understanding of common vulnerabilities…

More posts from themightymo.com

Reorganize Your WordPress 2.7 Admin Panel with Fluency 2.0

By | February 6, 2009

Yesterday I discovered the new Fluency 2.0 plugin for WordPress 2.7.  It does a fantastic job of cleaning up the admin interface and makes the back-end WordPress experience much better for users.

We Now Offer Search Engine Optimization!

By | February 2, 2009

We have just teamed up with one of the web’s finest search engine optimization gurus, Greg Cryns, and will now be offering his services to you, our customers! For you, our customer, this means that we now have added expertise in driving targeted traffic to your website. Greg has over a decade worth of search…

Adobe CS4 Flash MN Presentation at FlashMN

By | October 14, 2008

Below are my notes from tonight’s FlashMN meeting starring Dustin Tauer.  The presentation focused on the new features of Adobe Creative Suite 4. Illustrator CS4 Can create multiple art boards.  So, if I wanted to use artwork for the front and back of t-shirt, I would create 2 art boards (up to 100).  There are…

RSS From Toby’s Blog

  • WordPress Maintenance Checklist: Keep Your Site Running Smoothly
    Discover the essential tasks for effective WordPress maintenance and ensure your website runs smoothly and securely with our comprehensive guide.
  • Why We Don’t Automate Our WordPress Hosting Business
    There are some great platforms out there to automate your website hosting biz: But we don’t use any of them. Here’s why: Hosting companies only get worse over time. Over the years, I’ve hosted websites on a bunch of platforms: All of these hosting companies share one thing in common: Over time, they all got…
  • Fortify Your WordPress Site: Essential Security Steps
    Securing your WordPress site is a critical component of maintaining your online presence and safeguarding your data. Security is no longer a luxury, it has become a necessity in today’s digital world, where threats are lurking at every corner. This piece dives deep into WordPress security basics, giving you a comprehensive understanding of common vulnerabilities…