title: How to prevent SQLITE SQLSTATE[HY000] [14]?
body: <p>I receive sometimes the following error: </p>
  
  <blockquote>
    <p>SQLSTATE[HY000] [14] unable to open database file</p>
  </blockquote>
  
  <p>I open the datebase by using </p>
  
  <pre><code>new PDO("sqlite:database/datbase.db","","",array(
      PDO::ATTR_PERSISTENT =&gt; true
  ));
  </code></pre>
  
  <p>everytime I want read or write data from or to the database. The open process is the following function:</p>
  
  <pre><code>function opendatabase(){
  try{
      return new PDO("sqlite:database/database.db","","",array(
          PDO::ATTR_PERSISTENT =&gt; true
      ));
  }catch(PDOException $e){
      logerror($e-&gt;getMessage(), "opendatabase");
      print "Error in openhrsedb ".$e-&gt;getMessage();
  }
  }
  </code></pre>
  
  <p>After some time (sometime more than an hour, some times after some minutes I get the error message at the beginning of the post. How can I prevent such error? </p>