Cannot open file for reading PHP
<p>I am trying to open a file but for some reason I cannot even though the file is there and even has 777 permission. The code is the following:</p>

<pre><code>$fileatt = "/opt/lampp/htdocs/a.pdf";
echo "File size is ".filesize($fileatt)."&lt;br&gt;";
if (file_exists($fileatt)) {
    echo "The file ".$fileatt." exist &lt;br&gt;";

    $file = fopen($fileatt, ‘rb’);
    if ($file == false) {
        echo "Could not open the file !";
    }
} else {
    echo "The file ".$fileatt." does NOT exist &lt;br&gt;";
}
</code></pre>

<p>The result is:</p>

<pre><code>File size is 1252121
The file /opt/lampp/htdocs/a.pdf exist 
Could not open the file !
</code></pre>

<p>Why can't I open the file ? Where is my mistake ? </p>

<p>Thanks</p>
