#!/usr/bin/php Script cannot be called from web-browser (if you are indeed calling via cli, set environment variable PHP_IS_CLI to work around this).