Why would including an empty file make a PHP script fail?
<p>The following script fails if line #6 (.include ...) is uncommented - no matter what the content of the file "somefile.php" is. Even for a 0-byte (empty) file. I was trying to move such functions and create a "utils.php" library, is that a big no-no in the PHP world? Error_log is empty. I am using PHP 5.2.17 on Linux 2.6.32. Thank you.</p>

<pre><code>&lt;?php // File: index.php
error_reporting (E_ALL);
ini_set ('display_errors', 1);

//Uncomment the following line and the script fails
//.include "somefile.php";

function imageToBrowser ($pseudonym, $filePath) {
        header("Pragma: public");
        header("Expires: 0");
        header('Cache-Control: no-store, no-cache, must-revalidate');
        header('Cache-Control: pre-check=0, post-check=0, max-age=0', false);
        header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
        header("Content-Length: ".(string)(filesize($filePath)));
        header('Content-Type: application/x-download');
        header('Content-Disposition: attachment; filename="'.$pseudonym.'.png"');
        header('Content-Transfer-Encoding: binary');

        if ($file = fopen($filePath, 'rb')) {
                while(!feof($file) and (connection_status()==0)) {
                        print(fread($file, filesize($filePath)));
                        flush();
                }
                fclose($file);
}}

if (isset($_GET['showImage']) &amp;&amp; ($imageMask = $_GET['showImage'])) {
        imageToBrowser ($imageMask, 'Clear64.png'); // Use any .png file in $cwd
} else {
        echo "&lt;html&gt;&lt;body&gt;&lt;center&gt;\n";
        echo "&lt;img border='0' src=\"{$_SERVER['PHP_SELF']}?showImage=365\" alt=\"Missing Image\"/&gt;\n";
        echo "&lt;/center&gt;&lt;/body&gt;&lt;/html&gt;";
}
?&gt;
</code></pre>
