I have an installation and an EC2 instance on AWS, and as part of this instance I use a SQLite3 database to process certain data. All database operations are routed through a single PHP file with one connection:
function dataQuery($query)
{
try
{
$dbh = new PDO(DBW);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e)
{
echo $e->getMessage();
$errorCode = $e->getCode();
if('14' == $errorCode)
{
try
{
$dbh = new PDO(DBL);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e)
{
echo $e->getMessage();
$errorCode = $e->getCode();
}
}
}
try
{
$queryResults = $dbh->query($query);
if($queryResults != null)
{
$results = $queryResults->fetchAll(PDO::FETCH_OBJ);
$queryResults = NULL;
return $results;
}
}
catch(PDOException $e)
{
$errorMsg = $e->getMessage();
return $errorMsg;
}
}
DBWand DBLare constants defined only a few lines earlier. The error I get is:
could not find driver
"Why is this weird?" you ask. “Because the problem is not consistent,” I reply. Let me clarify ...
The first action that happens when someone goes to a site is a login that requires reading and writing to the database. This works great (how the application works on any "normal" server).
2|Jay Blanchard|jayblanchard@thewebsite.com|foo|{"roles":["admin", "surveyor"]}|2015-06-04 15:32:29|69.1.164.40
, , - . .
, , . , , :
drwxrwxrwx 10 ubuntu ubuntu 4096 Jun 4 15:32 application-gateway
:
-rwxrw-rw- 1 ubuntu ubuntu 65536 Jun 4 15:32 application.db
, , ubuntu .
, , PDO /etc/php5/apache2/conf.d/
lrwxrwxrwx 1 root root 32 Jun 3 15:29 05-opcache.ini -> ../../mods-available/opcache.ini
lrwxrwxrwx 1 root root 28 Jun 3 15:29 10-pdo.ini -> ../../mods-available/pdo.ini
lrwxrwxrwx 1 root root 29 Jun 3 15:29 20-json.ini -> ../../mods-available/json.ini
lrwxrwxrwx 1 root root 31 Jun 3 15:33 20-mysqli.ini -> ../../mods-available/mysqli.ini
lrwxrwxrwx 1 root root 30 Jun 3 15:33 20-mysql.ini -> ../../mods-available/mysql.ini
lrwxrwxrwx 1 root root 34 Jun 3 15:33 20-pdo_mysql.ini -> ../../mods-available/pdo_mysql.ini
lrwxrwxrwx 1 root root 33 Jun 3 15:29 20-readline.ini -> ../../mods-available/readline.ini
lrwxrwxrwx 1 root root 35 Jun 3 20:17 pdo_sqlite.ini -> ../../mods-available/pdo_sqlite.ini
, . . , .
PDO PHP -
AWS?