我已经在本地服务器上建立了一个站点,当我将其移至实时服务器时,它无法正常工作并显示错误页面
这是我正在使用的索引页
<?php
define('PROTECT','MOHAMED_PROTECT');
require_once('include/ini.php');
?>
sdf
和
include / ini.php
<?php
session_start();
ob_start();
// used for protection when someone enter here he is returned to index
if( defined('PROTECT')&&!empty(PROTECT) ){
if( PROTECT == 'MOHAMED_PROTECT' ){
require_once('config.php');
if( !isset($_SESSION['useremail']) && !isset($_SESSION['userpass']) )
{
$_SESSION['userid'] = uniqid();
$_SESSION['useremail'] = false;
$_SESSION['userpass'] = false;
}
// used for protection when someone enter here he is returned to index
}}else{header('location: /');}
我的配置是
<?php
// used for protection when someone enter here he is returned to index
if( defined('PROTECT')&&!empty(PROTECT) ){
if( PROTECT == 'MOHAMED_PROTECT' ){
$dsn = 'mysql:host=localhost;dbname=databaseXXX';
$user = 'userXXX';
$pass = 'passwordXXX';
try {
$con = new PDO($dsn, $user, $pass);
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e) {
echo 'Failed Because ' . $e->getMessage();
}
// used for protection when someone enter here he is returned to index
}}else{header('location: /');}
并且出现错误 是 此页面无法正常运行,目前无法处理此请求。 HTTP错误500
现在是什么问题?