I installed PHP, MySQL 5, and Light TPD on my Beaglebone Black Wireless (running Debian image 2017-07-01). I tried creating a webpage that displays a MySQL table, but noticed that the table wasn't even appearing. So in order to isolate the problem, I created a simple PHP program that does nothing but display some text and a table with only one row. I began adding things from the larger program one at a time until I found what was causing the tables to disappear. Here is the relevant code:
<html>
<head>
<title>Table Test</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<BODY>
<?php include('NAV.php') ?>
<?php
echo "Table Test<br>";
//////////////////////////////////////////////////////
// Connecting to the Database
//////////////////////////////////////////////////////
$con = mysqli_connect("localhost","root","pass", "dB");
//Print HTML table
echo "<TABLE width=40% cellpadding=5 cellspacing=0 border=1>";
echo "
<TR>
<TD><b>ID</TD>
<TD><b>LOCATION</TD>
<TD><b>SEQUENCE</TD>
<TD><b>TIME</TD>
<TD><b>UPDATE</TD>
<TD><b>DELETE</TD>
</TR>";
?>
</body>
</html>
I discovered that this line is what causes the problem:
$con = mysqli_connect("localhost","root","pass", "dB");
The table displays just fine on an older Beaglebone (Debian image 2015-11-12). I find it hard to believe that simply declaring a variable would cause an entire table to dissappear. Any help in this matter would be greatly appreciated.
UPDATE (8/15/2017 13:04 EST): I checked the error log (/var/log/lighttpd/error.log) and found the following:
2017-08-15 17:02:39: (mod_fastcgi.c.2702) FastCGI-stderr: PHP Fatal
error: Call to undefined function mysqli_connect() in /var/www
/html/TABLE2.php on line 25