I have a fresh install of fedora 12 and am trying to get php and sqlite working I installed php through: yum install php php-devel php-pdo
and restarted apache. Php pages are working just fine but whenever I try to load a page that uses sqlite the page is not processed and returns blank with non of the php code being processed. The page that i am using to test sqlite is:
<html>
<head></head>
<body>
<?php
// set path of database file
$db = $_SERVER['DOCUMENT_ROOT']."/../library.db";
// open database file
$handle = sqlite_open($db) or die("Could not open database");
// generate query string
$query = "SELECT * FROM books";
// execute query
$result = sqlite_query($handle, $query) or die("Error in query: ".sqlite_error_string(sqlite_last_error($handle)));
// if rows exist
if (sqlite_num_rows($result) > 0) {
// get each row as an array
// print values
echo "<table cellpadding=10 border=1>";
while($row = sqlite_fetch_array($result)) {
echo "<tr>";
echo "<td>".$row[0]."</td>";
echo "<td>".$row[1]."</td>";
echo "<td>".$row[2]."</td>";
echo "</tr>";
}
echo "</table>";
}
// all done
// close database file
sqlite_close($handle);
?>
</body>
</html>
The body and html tags are returned but non of the php is rendered. My question is how does one set up php with sqlite. Does one have to recompile, is their an rpm? I am looking for a step by step way of enabling sqlite for php. Thanks