PHP 给我一个空白页
PHP Gives me a blank page
所以我有这个我昨天正在处理的页面,我有一些错误并且仍在完成上面的所有内容但是当我停止时我加载页面正常。然而今天当我加载页面时它是空白的,也不是完全空白但它在文件中的某个点停止加载内容(见下文)。
现在奇怪的是,如果我把它放在评论中它不会改变任何东西,当我把所有 php 代码放在它甚至不会改变任何东西。所以我有点卡住了....
编辑:所以我刚刚意识到我忘记提供 link,虽然在网上查找时它给出了一个完整的空白页......
http://hmorreels.hol.es/Morreels_App/index.php/charts
遗憾的是,虽然这是一个内部 500 错误,但那里的信息不多:/
也许你们当中有人看到了?
我已经把页面放到网上,我把我的代码放在这里......
此页面使用 laravel 作为框架,但大部分页面都很简单 PHP.
<?php
use Illuminate\Support\Facades\DB;
include "config.php";
$init = false;
/* Check if the charts page is given a company ID or not */
/* ===================================================== */
if (isset($company_identifier)) {
/* The page has gotten the company ID, this means we can go forth and do our calculations, show the graphs and stuffs */
/* ================================================================================ ================================== */
$init = true;
}
$raspis = DB::table("raspi_installations")->get();
foreach ($raspis as $raspi) {
$val = $raspi["serial_ID"];
$val = "raspi_" . $val;
$$val = $raspi;
}
$companies = DB::table('companies')->get();
foreach ($companies as $table) {
//die() WORKS UNTIL THIS LINE AFTER THE NEXT ONE IT STOPS WORKING
//===============================================================
$$table['company_identifier'] = DB::table($table['company_identifier'])->get();
}
$engineers = DB::table('users')->get();
$Hydrauliek_Morreels_NV = DB::table('Hydrauliek_Morreels_NV')->get();
$i=0;
?>
<head>
<link rel="stylesheet" href="/Morreels_App/public/styles/css/charts.css">
</head>
<html>
<body>
<?php include "header.php"; ?>
<div id="main_panel">
<div class="flowx" id="panelhead" style="height:300px;">
<div class="col colspan-3-of-3">
<h1>Charts</h1>
<p><?php echo trans('panelheaders.charts'); ?></p>
<br/>
<select name="company" id="company">
<?php foreach($companies as $company) : ?>
<option id="" value="/Morreels_App/index.php/charts/<?php echo $company["id"]; ?>"><?php echo $company["company"]; ?></option>
<?php endforeach; ?>
</select>
<?php foreach($companies as $company) : ?>
<div id="<?php echo $company["company_identifier"]; ?>">
<form action="<?php echo $company["id"]; ?>">
<?php foreach($$company["company_identifier"] as $row):?>
<?php $name = "raspi_" . $row["raspi_ID"]; $current_dxd = $$name; die(print_r($$name)); ?>
<?php foreach ($row as $key => $value): ?>
<?php if($key == "temperature" || $key == "rH" || $key == "oilfilter_1" || $key == "oilfilter_2" || $key == "oilfilter_3"): ?>
<label for="<?php echo $key; ?>"><input type="checkbox" value="<?php echo $value; ?>" name="<?php echo $value; ?>" id="<?php echo $key; ?>"><?php echo $key; ?></label>
<?php endif; ?>
<?php if($key != "temperature" && $key != "rH" && $key != "oilfilter_1" && $key != "oilfilter_2" && $key != "oilfilter_3" && $key != "updated" && $key != "entry_ID"): ?>
<label for="<?php echo $current_dxd[$key]; ?>"><input type="checkbox" value="<?php echo $value; ?>" name="<?php echo $value; ?>" id="<?php echo $current_dxd[$key]; ?>"><?php echo $current_dxd[$key]; ?></label>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</form>
</div>
<?php endforeach; ?>
</div>
</div>
<div id="content" style="background-color: #ECF2F6">
<?php if($init): ?>
<div class="col colspan-2-of-3 chart">
<h1>
<?php
$id = $company_identifier - 1;
echo $companies[$id]['company'];
?>
</h1>
</div>
<div class="col colspan-1-of-3">
<div id="action_holder">
<p>If you wish to see the graphs in detail and stop the live feed of them, please click here,</p>
<button class="btn btn-default" id="STOP">Stop</button>
</div>
<div id="action_holder2">
<p> <?php echo trans('panelheaders.charts2'); ?></p>
<a style='text-decoration: none;' href='<?php echo $url; ?>'><button class='btn btn-primary'><?php echo trans('basic.reload'); ?> </button></a>
</div>
</div>
<!-- CHART 1: TEMPERATURE -->
<div id="temperature_chart" class="col colspan-3-of-3">
</div>
<div id="rH_chart" class="col colspan-3-of-3">
</div>
<!-- CHART 2: PM CHARTS -->
<div class="chart col colspan-3-of-3">
<div id="pm_chart_holder">
</div>
</div>
<?php endif; ?>
</div>
<script type="text/javascript" src="/Morreels_App/public/chartjs/Chart.js"></script>
<script src="/Morreels_App/public/scripts/js/chartfeed.js"></script>
<script>
</script>
</body>
</html>
您的网络服务器配置有误。您的 Web 服务器(Apache、Nginx)应指向 public
目录。正确设置的 URL 将是:
http://hmorreels.hol.es/charts
但不是:
http://hmorreels.hol.es/Morreels_App/index.php/charts
如果您使用的是 Apache,请。
此外,不要忘记在 storage
文件夹上设置正确的权限,对于 Unix,它将是:
chmod -R 775 storage
在 Laravel 内,您可以在 Exceptions/Handler 内或仅在 Log::error($e) 内设置断点。这将捕获所有异常。可能是错误和重定向导致的。
你检查过laravel日志和apache/nginx日志了吗?
我修好了,这是我的错,伙计们,我非常抱歉,SQL 函数试图从我的 MySQL table 加载 641.574 行。
这个馈送系统是 运行 24/7,我不认为它太大,因为我最近才从我的 table 中移除限制器:)
所以...,很抱歉浪费您的时间...虽然您确实教了我一些关于错误日志的知识;)
非常感谢您的帮助,无论如何,伙计们真的很感激!
所以我有这个我昨天正在处理的页面,我有一些错误并且仍在完成上面的所有内容但是当我停止时我加载页面正常。然而今天当我加载页面时它是空白的,也不是完全空白但它在文件中的某个点停止加载内容(见下文)。
现在奇怪的是,如果我把它放在评论中它不会改变任何东西,当我把所有 php 代码放在它甚至不会改变任何东西。所以我有点卡住了....
编辑:所以我刚刚意识到我忘记提供 link,虽然在网上查找时它给出了一个完整的空白页...... http://hmorreels.hol.es/Morreels_App/index.php/charts 遗憾的是,虽然这是一个内部 500 错误,但那里的信息不多:/
也许你们当中有人看到了? 我已经把页面放到网上,我把我的代码放在这里...... 此页面使用 laravel 作为框架,但大部分页面都很简单 PHP.
<?php
use Illuminate\Support\Facades\DB;
include "config.php";
$init = false;
/* Check if the charts page is given a company ID or not */
/* ===================================================== */
if (isset($company_identifier)) {
/* The page has gotten the company ID, this means we can go forth and do our calculations, show the graphs and stuffs */
/* ================================================================================ ================================== */
$init = true;
}
$raspis = DB::table("raspi_installations")->get();
foreach ($raspis as $raspi) {
$val = $raspi["serial_ID"];
$val = "raspi_" . $val;
$$val = $raspi;
}
$companies = DB::table('companies')->get();
foreach ($companies as $table) {
//die() WORKS UNTIL THIS LINE AFTER THE NEXT ONE IT STOPS WORKING
//===============================================================
$$table['company_identifier'] = DB::table($table['company_identifier'])->get();
}
$engineers = DB::table('users')->get();
$Hydrauliek_Morreels_NV = DB::table('Hydrauliek_Morreels_NV')->get();
$i=0;
?>
<head>
<link rel="stylesheet" href="/Morreels_App/public/styles/css/charts.css">
</head>
<html>
<body>
<?php include "header.php"; ?>
<div id="main_panel">
<div class="flowx" id="panelhead" style="height:300px;">
<div class="col colspan-3-of-3">
<h1>Charts</h1>
<p><?php echo trans('panelheaders.charts'); ?></p>
<br/>
<select name="company" id="company">
<?php foreach($companies as $company) : ?>
<option id="" value="/Morreels_App/index.php/charts/<?php echo $company["id"]; ?>"><?php echo $company["company"]; ?></option>
<?php endforeach; ?>
</select>
<?php foreach($companies as $company) : ?>
<div id="<?php echo $company["company_identifier"]; ?>">
<form action="<?php echo $company["id"]; ?>">
<?php foreach($$company["company_identifier"] as $row):?>
<?php $name = "raspi_" . $row["raspi_ID"]; $current_dxd = $$name; die(print_r($$name)); ?>
<?php foreach ($row as $key => $value): ?>
<?php if($key == "temperature" || $key == "rH" || $key == "oilfilter_1" || $key == "oilfilter_2" || $key == "oilfilter_3"): ?>
<label for="<?php echo $key; ?>"><input type="checkbox" value="<?php echo $value; ?>" name="<?php echo $value; ?>" id="<?php echo $key; ?>"><?php echo $key; ?></label>
<?php endif; ?>
<?php if($key != "temperature" && $key != "rH" && $key != "oilfilter_1" && $key != "oilfilter_2" && $key != "oilfilter_3" && $key != "updated" && $key != "entry_ID"): ?>
<label for="<?php echo $current_dxd[$key]; ?>"><input type="checkbox" value="<?php echo $value; ?>" name="<?php echo $value; ?>" id="<?php echo $current_dxd[$key]; ?>"><?php echo $current_dxd[$key]; ?></label>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</form>
</div>
<?php endforeach; ?>
</div>
</div>
<div id="content" style="background-color: #ECF2F6">
<?php if($init): ?>
<div class="col colspan-2-of-3 chart">
<h1>
<?php
$id = $company_identifier - 1;
echo $companies[$id]['company'];
?>
</h1>
</div>
<div class="col colspan-1-of-3">
<div id="action_holder">
<p>If you wish to see the graphs in detail and stop the live feed of them, please click here,</p>
<button class="btn btn-default" id="STOP">Stop</button>
</div>
<div id="action_holder2">
<p> <?php echo trans('panelheaders.charts2'); ?></p>
<a style='text-decoration: none;' href='<?php echo $url; ?>'><button class='btn btn-primary'><?php echo trans('basic.reload'); ?> </button></a>
</div>
</div>
<!-- CHART 1: TEMPERATURE -->
<div id="temperature_chart" class="col colspan-3-of-3">
</div>
<div id="rH_chart" class="col colspan-3-of-3">
</div>
<!-- CHART 2: PM CHARTS -->
<div class="chart col colspan-3-of-3">
<div id="pm_chart_holder">
</div>
</div>
<?php endif; ?>
</div>
<script type="text/javascript" src="/Morreels_App/public/chartjs/Chart.js"></script>
<script src="/Morreels_App/public/scripts/js/chartfeed.js"></script>
<script>
</script>
</body>
</html>
您的网络服务器配置有误。您的 Web 服务器(Apache、Nginx)应指向 public
目录。正确设置的 URL 将是:
http://hmorreels.hol.es/charts
但不是:
http://hmorreels.hol.es/Morreels_App/index.php/charts
如果您使用的是 Apache,请
此外,不要忘记在 storage
文件夹上设置正确的权限,对于 Unix,它将是:
chmod -R 775 storage
在 Laravel 内,您可以在 Exceptions/Handler 内或仅在 Log::error($e) 内设置断点。这将捕获所有异常。可能是错误和重定向导致的。
你检查过laravel日志和apache/nginx日志了吗?
我修好了,这是我的错,伙计们,我非常抱歉,SQL 函数试图从我的 MySQL table 加载 641.574 行。
这个馈送系统是 运行 24/7,我不认为它太大,因为我最近才从我的 table 中移除限制器:)
所以...,很抱歉浪费您的时间...虽然您确实教了我一些关于错误日志的知识;)
非常感谢您的帮助,无论如何,伙计们真的很感激!