Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [14] unable to open database file'
<p>So I'm making a website for a client that uses a SQLite Database and PHP to display information in a Table on one of the pages of the site. When running the page I get this error. From what I understand it's caused by the database and/or directory to the database not having the correct permissions to access it. I'm working on a Charter Business Server and from what I can tell, I have the correct permissions set. I've tried Googling the issue but found nothing that has helped.</p>

<p>Here is the PHP code:</p>

<pre><code> &lt;?php ini_set('display_errors', 1);
    $dir = 'sqlite:/HTML/fsrd2.com/database/fsrd.db';
    $database = new PDO($dir) or die("&lt;tr&gt;&lt;td&gt;Cannot Open&lt;/td&gt;&lt;/tr&gt;");
    $query = "SELECT * FROM projects";
    foreach($database-&gt;query($query) as $row)
    {
        echo "&lt;tr&gt;";
        echo "&lt;td&gt;" . $row['name'] . "&lt;/td&gt;";
        echo "&lt;/tr&gt;";
    }
  ?&gt;
</code></pre>

<p>And here is the full error message:</p>

<pre><code>Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [14] unable to open database file' in /var/www/vhosts/12/234028/webspace/httpdocs/fsrd2.com/fsrd_projects.php:50 Stack trace: #0 /var/www/vhosts/12/234028/webspace/httpdocs/fsrd2.com/fsrd_projects.php(50): PDO-&gt;__construct('sqlite:/HTTP/fs...') #1 {main} thrown in /var/www/vhosts/12/234028/webspace/httpdocs/fsrd2.com/fsrd_projects.php on line 50 
</code></pre>