title: PHP – get the size of a directory
body: <p>What is the best way to get the size of a directory in PHP? I'm looking for a lightweight way to do this since the directories I'll use this for are pretty huge.</p>
  
  <p>There already was a <a href="https://stackoverflow.com/questions/478121/php-get-directory-size">question</a> about this on SO, but it's three years old and the solutions are outdated.(Nowadays <code>fopen</code> is disabled for security reasons.)</p>