2008-12-18

More on masterhost

I use symfony framework for my web development. I'm very glad that this one doesn't enforce you to use the directory structure it creates by default. So, if your shared host public directory is not "web" (symfony default), but something like "www" or "public_html", just call setWebDir method from your project confirugation's setup method, just like this:
class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    $this->setWebDir(sfConfig::get('sf_root_dir').'/www');
    // Change "www" to your public directory name
  }
}

Masterhost and 411 Content Length required

Hey, guys, I just discovered a glitch on Masterhost servers. If you get 411 from their nginx, try looking up your error_log. That might be not the problem of your client not setting Content-Length while sending chunked content.

If your error_log says something like "Failed to create file upload directory "/var/tmp"", look for tempnam() function in your code. This thingie is trying to create temporary file in masterhost's server own /tmp, not your virtual host's one. The only solution is to avoid using tempnam().