title: file is encrypted or is not a database - sqlite
body: <p>I have some trouble to open a sqlite file</p>
  
  <p>In the command line I get this:</p>
  
  <pre><code>#sqlite3 sms.db
  SQLite version 3.6.20
  Enter ".help" for instructions
  Enter SQL statements terminated with a ";"
  sqlite&gt; select * from message;
  Error: file is encrypted or is not a database
  </code></pre>
  
  <p>The error is not when I connect, it's when I run a query</p>
  
  <p>Checking the file gets me this</p>
  
  <pre><code># file sms.db
  sms.db: SQLite 3.x database
  </code></pre>
  
  <p>So it should not be a version problem - like opening a sqlite2 file with sqlite3</p>
  
  <p>In php I have this:</p>
  
  <pre><code>try 
  {
      /*** connect to SQLite database ***/
  
      $db = new PDO("sqlite:path/sms.db");
      echo "Handle has been created ...... &lt;br&gt;&lt;br&gt;";
  
  }
  catch(PDOException $e)
  {
      echo $e-&gt;getMessage();
      echo "&lt;br&gt;&lt;br&gt;Database -- NOT -- loaded successfully .. ";
      die( "&lt;br&gt;&lt;br&gt;Query Closed !!! $error");
  }
  
  $result = $db-&gt;query('SELECT * from message') or var_dump($db-&gt;errorInfo());
  </code></pre>
  
  <p>Gets me this (not at connect but when the query is executed)</p>
  
  <pre><code>array(3) { [0]=&gt; string(5) "HY000" [1]=&gt; int(26) [2]=&gt; string(38) "file is encrypted or is not a database" } 
  </code></pre>
  
  <p>I use a Sql manager extension for firefox and there I can open the file without any problems(and run any query without any encryption or password). This is really strange for me. I have searched about this for the last hours but I didn't find any solution. Any help would be appreciated. </p>
  
  <hr>
  
  <p>I have just tested on windows and I can open the database. I think the problem is related to the sqlite drivers.</p>
  
  <p>On windows I have SQLite Library    3.7.7.1 
  On my centos server I have SQLite Library   3.6.20 </p>
  
  <p>Now the question is how do I update the php sqlite extension. I can not update the entire php (it may cause errors )</p>
  
  <p>Commands like yum install php-pdo, yum install php5-sqlite3, do not work</p>