I had to deal whit a hosting that (amongst other stuff) didn't expose the mentioned variable.
The solution:
Simply put this code at the begining of sapphire/main.php
$_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'] . $_SERVER['SCRIPT_NAME'];
At least that did the trick for me this time.
Hope this helps someone.