Add check for PHP_SAPI