2016-04-15 90 views
1

所以我有我昨天正在工作的这个页面,并且我有一些错误,并且仍然完成了对它的完成,但是当我停止时,我加载了页面。然而今天,当我加载页面时,它是空白的,不完全空白,但它停止加载文件中某个点的内容(见下文)。PHP给了我一个空白页

现在奇怪的是,如果我把它放在注释中,它不会改变任何东西,当我把所有的PHP代码甚至不会改变任何东西。所以我有点卡住了....

编辑:所以我才意识到,我忘了给的链接,虽然网上找时,它提供一个完整的空白页... 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> 
+0

您能否在这里发布您的错误日志? – VipindasKS

+0

我得到的所有我知道的0错误,所以我应该在哪里寻找这个呢? (服务器上的错误日志文件=空,页面空错误) –

回答

1

您错误的Web服务器配置。您的网络服务器(Apache,Nginx)应指向public目录。 Corrent网址与正确的设置将是:

http://hmorreels.hol.es/charts 

但不是:

http://hmorreels.hol.es/Morreels_App/index.php/charts 

如果你使用Apache,请read this

另外,不要忘了在storage文件夹设置正确的权限,在Unix这将是:

chmod -R 775 storage 
+0

我知道我不会花费我的时间在免费的服务器上这样做,它不允许对htaccess文件进行任何更改,如果我将它移动到生产服务器几个星期,它已经成立这样工作:) –

+0

事情是你可能会得到像你这样的奇怪行为,只是因为配置错误。 –

+0

真的吗? :o那个,我的好先生是我不知道的东西:)(可惜我没有很多其他的选择,当谈到免费测试服务器:/和。htaccess文件不可访问,所以propably不可能修复:/)也许一旦生产服务器运行,我可以在那里测试(如果错误仍然存​​在) –

1

在Laravel,您可以例外/处理程序中设置一个断点,或只是登录::错误($ E)。这将捕获所有异常。它可能由错误和重定向引起。

你检查laravel日志和apache/nginx日志吗?

+0

对不起,看起来像一个新手在这里,但我从来没有使用过Log :: error ($ e)之前似乎并不希望被静态调用,似乎无法找到任何关于如何把这个在我的文件(laravel网站说,键入,如你所做的),但这不适用于我。 –

0

我修好了,这是我的错,球员,我非常抱歉,SQL函数试图从我的MySQL表中加载641.574行。

该送料装置运行24/7,我不认为它太大了,因为我最近才取出从我的表:)

所以......限制器,对不起,这个浪费你的时间...虽然你确实教会了我一些关于错误日志的内容;)

感谢百万人的帮助,反正人们真的很感激它!