【发布时间】:2013-04-30 11:11:55
【问题描述】:
我从 sourceforge.net 下载了一个名为 Employee Scheduler 的 php 项目。问题是,index.php 应该是主页,但是当我通过 localhost 访问它时没有显示任何内容。我计算机中的其他 php 项目在我访问它们时正在运行,但这个员工调度程序除外。我很确定我也在访问正确的文件夹,在
中访问它localhost/scheduler/index.php
甚至在同一目录中创建一个测试 php 文件并访问它。测试 php 文件有效,并且 index.php 仍然没有显示任何内容。这可能是什么问题?
我在我的 Windows 7 计算机上使用 WAMP。
编辑:
我在 php 文件的第一行包含了error_reporting(E_ALL);,但它仍然没有输出任何内容。什么给了?
我会把 index.php 的内容贴在这里:
<?php
/*********************************************************
File: index.php
Project: Employee Scheduler
Author: John Finlay
Comments:
The home page for the site. Asks a user to login
and then redirects them to the appropriate section
for employees or supervisors
For site documentation and setup see the README.txt file
included with the distrobution package. If you did not
receive this file, it can be found at
http://empscheduler.sourceforge.net
Copyright (C) 2003 Brigham Young University
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
**********************************************************/
error_reporting(E_ALL);
require "es_functions.php";
//-- authenticate the user
$user = auth_user();
$url = "";
//-- if they are a supervisor then forward them to the supervisor home page
if (preg_match("/(Supervisor)|(Admin)/", $user["u_type"])) $url= "es_sup_index.php?".session_name()."=".session_id();
//-- forward to employee homepage
else $url = "es_emp_index.php?".session_name()."=".session_id();
header("Location: $url");
print_header("Welcome");
print_r($user);
print "<br /><br />If you are seeing this, your browser did not forward you to the correct page. Click <a href=\"$url\">here</a> to continue.<br />\n";
print_footer();
exit;
?>
【问题讨论】:
-
你有错误报告吗?服务器日志中是否有任何内容?
-
index.php 有一个错误导致它不显示任何内容,并且应用程序关闭了错误报告,因此什么也没有显示
-
在第一行添加
<?php,error_reporting(E_ALL)然后运行页面并将错误放在这里 -
我已包含 error_reporting(E_ALL);在 php 文件的第一行,但它仍然没有输出任何内容。我编辑了我的问题并包含了 index.php 的内容。
-
您可以通过 WAMP 系统托盘图标访问 PHP 错误日志。这说明什么?最可能的候选是它找不到您需要的文件 (es_functions.php) - 您是否指向正确的位置?
标签: php wamp sourceforge