title: Minimum permissions needed to allow PHP PDO / Apache access to SQLite database in /var/www
body: <p><strong>SOLVED:</strong> See my answer below</p>
  
  <p>I'm experiencing the same issue that Austin Hyde experienced in <a href="https://stackoverflow.com/questions/3319112/pdo-sqlite-read-only-database">this question</a>.  I have an SQLite database that I can read, but not write. </p>
  
  <p>Specifically, I'm getting <strong>General error: 8 attempt to write a readonly database in /var/www/html/green/database.php on line 34</strong></p>
  
  <p>My issue diverges from his as follows:</p>
  
  <p>-As recommended in the answers to his question, I've made the database world-writeable, as well as the folder in which the database resides, with no luck.  I've also set the owner of the database to "apache" as well as "nobody", without success.</p>
  
  <p>-I've set the entire path set 777, beginning at /var (which I hate to do), no joy.</p>
  
  <p>-I've messed about with SELinux (I'm running Fedora 12) to let httpd do whatever it wants; nothing. </p>
  
  <p>I feel that I'm almost certainly missing something simple here, but I'm out of ideas.</p>
  
  <p><strong>What permissions need to be on an SQLite file in order to allow PHP / Apache to read and write to it via PDO?</strong></p>
  
  <p>Edit: Another <a href="https://stackoverflow.com/questions/2039218/why-can-i-use-select-but-not-insert-on-a-sqlite-database-in-php">related question</a>, adding weight to the hypothesis that I've got a write permissions conflict somewhere.</p>