Web ページに致命的なエラー出力が表示されます。これはエラーです:
致命的なエラー: /Users/aaronwilson/Desktop/testing_server/ATOM_CMS/config/setup.php:14 スタック内のメッセージ「SQLSTATE[HY000] [2005] Unknown MySQL server host '$host' (20)」を伴うキャッチされない例外 'PDOException' trace: #0 /Users/aaronwilson/Desktop/testing_server/ATOM_CMS/config/setup.php(14): PDO->__construct('mysql:host=$hos...', 'atomcmsadmin', ' ** ') #1 /Users/aaronwilson/Desktop/testing_server/ATOM_CMS/config/setup.php(22): dbConnect('atomcmsadmin', ' ** ', 'localhost', 'Atom_CMS') #2 /Users/aaronwilson/Desktop/ testing_server/ATOM_CMS/index.php(2): include('/Users/aaronwil...') #3 {main} が 14 行目の /Users/aaronwilson/Desktop/testing_server/ATOM_CMS/config/setup.php でスローされました
私の Setup.php ページでエラーを引き起こしているコードは次のとおりです。
<?php ## Setup Document
// host(or location of the database), username, password, database name
//Variables for connecting to your database.
//These variable values come from your hosting account.
error_reporting(E_ALL);
ini_set('display_errors', 1);
require('functions/sandbox.php');
$host = "localhost";
$user = "atomcmsadmin";
$pass = "*******";
$dbname = "Atom_CMS";
//Connecting to your database
function dbConnect($user, $pass, $host, $dbname) {
$dbc = new PDO('mysql:host=$host;dbname=$dbname', $user, $pass);
try {
global $dbc;
}
catch (PDOException $e) {
echo $e->getMessage();
}
}
if (dbConnect($user, $pass, $host, $dbname)) {
print('worked');
}
if ($_GET ['page'] == '') {
$pg = 'home';}
else {
$pg = $_GET ['page']; }
$page_title = get_title($dbc, $pg);
?>
任意の提案をいただければ幸いです.. :)