I'm a bit confused about this problem This is how I connect to the DB:
<?php
if(!defined('CMS')) {
die('ERROR 174909812632');
}
require_once("settings.php");
try {
$db = new PDO('mysql:host=' . _DB_HOST . ';dbname=' . _DB_NAME, _DB_USER, _DB_PASS);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(Exception $e) {
echo 'Exception -> ';
var_dump($e->getMessage());
die();
}
?>
When I require the above file from the index in the web root everything goes fine, connection is established, I can retrieve rows, anything. However, when I require the same file from a subdirectory I get a fatal error as if the module wasn't present
Fatal error: Class 'PDO' not found in /home/myusername/public_html/mysql_connect.php on line 10
What am I missing here?