title: PHP serial port reading, doesn't load the site
body: <p>So I want to read virtual serial port with PHP. I can write to the serial port without problem but when i try to read the page doesn't load.</p>
  
  <p>I've tried fread, fgets. I also send new line (.PHP_EOL) but nothing works.</p>
  
  <pre><code>$fp = fopen("/dev/pts/3","w+");
  $fp2 = fopen("/dev/pts/2","w+");
  
  if(!$fp || $fp2){
  echo "Error!";
  die();
  }
  
  else{
  
  fwrite($fp, "works".PHP_EOL);
  fwrite($fp2, "works too".PHP_EOL);
  $data = fgets($fp);
  echo $data;
  
  fclose($fp);
  fclose($fp2);
  }
  </code></pre>
  
  <p>I would like to get back my text, but the webpage doesn't load at all. If I remove the "fgets" part it works fine.</p>