【发布时间】:2016-04-13 21:27:27
【问题描述】:
我的 XAMPP 在一台计算机上运行良好。然后我将它安装在另一个上并使用相同的文件我有以下问题。
localhost:82 调出 index.php 文件(实际上它可以重定向到 index3.html)。我在那里输入我的密码,通常它会将我重定向到 localhost:82/home.php (并且它在我的另一台计算机上)但是在这台计算机上,它需要大约 10 秒的等待,然后我得到一个连接错误页面铬和IE。我注意到这是由于 XAMPP apache 服务器在返回绿色状态之前短暂变黄所致。
我也无法直接连接到 localhost:82/home.php。我犯了同样的错误。
我在每个 .php 页面的开头都有这个。删除它并没有解决问题。
<?php
session_start();
//Check to make sure the person is loggedin
if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'] == true) {
//if logged in then do nothing
} else {
//if not logged int he redirect to the login page
header("Location: http://localhost:82/index2.php");
}
?>
它在我的第一台电脑上运行良好,这是怎么回事?
=============================
编辑:这是我的 INDEX.PHP 上的代码
<?php
//Connect to a database
$host_name = "localhost";
$database = "db608008888";
$user_name = "ABC";
$password = "123";
$connect = mysqli_connect($host_name, $user_name, $password, $database);
//Take the values from the html form and assign them to variables
$ID = $_POST['name'];
$userpassword = $_POST['password'];
//If no passsowrd entered then go straight to index.php
echo "<script type='text/javascript'>alert($userpassword);</script>";
if ($userpassword == null) {
header("Location: http://localhost:82/index3.php");
die();
}
//Check to see if the password matches the hashes
if (md5($userpassword) === '5b5c45f1b9e444d9e441211cfb325270'
or md5($userpassword) === '17434cf0d4ba816cd776ff8b0ec532f1'
or md5($userpassword) === '7a94fda2a6e81a1693533e6dc8501b37'
or md5($userpassword) === '2d8b2ba14eeb0ac1fe474d468b720771')
{
//Add the visitor name to our list
mysqli_query($connect, "INSERT INTO `visitor list` (`Visitor Name`) VALUES ('$ID')") or die("Error in INSERT: ".mysqli_error($connect));
// Start the session so they can access other pages
session_start();
$_SESSION['loggedIn'] = true;
// Redirect them to rest of site
header("Location: http://localhost:82/home.php");
die();
}
else {
header("Refresh: 0; url=index2.php");
echo "<script type='text/javascript'>alert(\"Wrong Password. .\");</script>";
}
?>
【问题讨论】:
-
apache logfile(s)、php logfile(s) 和/或windows event log 中是否存在与问题相关的内容?
-
在事件查看器中我有很多这些:错误的应用程序名称:httpd.exe,版本:2.4.18.0,时间戳:0x5667f02e 错误的模块名称:php7ts.dll,版本:7.0.1.0,时间戳:0x5671ed04 异常代码:0xc0000005 错误偏移量:0x0001ac04 错误进程 id:0x7f8 错误应用程序启动时间:0x01d14a9e618e67c3 错误应用程序路径:C:\xampp\apache\bin\httpd.exe 错误模块路径:C:\xampp\php\ php7ts.dll 报告 ID:a04d87bd-b691-11e5-be9b-d050990c9b8b 错误包全名:错误包相关应用程序 ID:
-
在 apache 错误日志中突出显示:[ssl:warn] [pid 740:tid 372] AH01909: www.example.com:443:0 服务器证书不包含与服务器匹配的 ID名称
-
您是使用“香草”XAMPP 安装还是添加/替换例如.dll 或类似的东西?
-
PHP 脚本不应该™ 能够导致杀死 apache 的访问冲突 (0xc0000005)。我会:a)检查硬盘 b)从(几乎)任何 linux cd 运行 memtest c)从头开始重新安装 xampp