Free Disk Space status w/o logging in to Web Panel

software development


If you SSH to your Dreamhost webserver and run the ‘df’ command, you cannot get the actual free disk space for your disk quota at Dreamhost. Instead, you have to login to the Web Panel and manually lookup the disk space usage.

This is a set of PHP scripts that will automate all this. This is what it does:

  1. Use CURL to act like a web browser: goto login page; login; request status after login. It saves a cookie file to perform these steps and deletes the cookie when finished.
  2. The response is formatted as JSON. And the version of PHP is 4.x, which doesn’t support JSON.
  3. Use the included json.php file to convert the JSON into a PHP object variable. This file is from here:

To avoid markup problems, the code is posted here:


Very nice!

By the way, while in SSH you can type quota for some quick info.

Returns blocks - knocking off 6 digits gives approx GB :wink:

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost