title: Warning: fread(): Length parameter must be greater than 0
body: <p>I want to create a system with license with my own code,but gives me an error</p>
  
  <p>the code is like this and in lic.txt is the same 1234567,what is wrong?</p>
  
  <p>This is the error,if i put @ in front of fread dosent show the error but does not open the file</p>
  
  <blockquote>
    <p>Warning: fread(): Length parameter must be greater than 0 in /home/u422978792/public_html/platforma/license/index.php on line 7
        Invalid license key</p>
  </blockquote>
  
  <pre><code>        &lt;?php
  
  
  
      $fp = fopen("http://platforma.dar-project.org/license/lic.txt", "r");
      stream_set_timeout($fp, 10);
      $license = fread($fp, filesize($filename));
      fclose($fp);
  
      if ($license == "1234567") {
  
      echo "Your license key is valid";
  
      } else {
  
      die("Invalid license key");
      }
  
      ?&gt;
  </code></pre>