I'm creating 2 monitoring projects here in the company with 2 monitoring pages that will use PHP and HTML and will run on Raspberry Pi 2 (Raspbian) board. The code is very simple, I can open it normally in Windows, but in Raspbian is occurring as picture below (sorry for the quality, I took the phone):
ItpresentsapartofthePHPcodeandtheend,thenaddstheimage(inhtml)onlywithouttherestofthecode.Hereisthebeginningofthecodetogetanidea:
<!DOCTYPEhtml><html><head><metacharset="UTF-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
<script type="text/javascript">
setTimeout(function(){ location.reload(); }, 30000);
</script>
<title>Topologia Band</title>
</head>
<?php
function teste_ping ($host, $ip="173.0.0.1")
{
$data = date('_d_m');
$f = fopen("ping$data.csv", 'r');
if ($f)
{
while (($linha=fgetcsv($f))!==FALSE)
{
if ((string)$ip==(string)$linha[0])
{
if($linha[1] == "1")
{
echo "<div class='$host'><i class='verde fa fa-2x fa-wifi'></i></div>";
break;
}
else
{
echo "<div class='$host'><i class='vermelho fa fa-2x fa-wifi'></i></div>";
break;
}
}
elseif ((string)$ip!=(string)$linha[0])
{
echo "<div class='$host'><i class='azul fa fa-2x fa-wifi'></i></div>";
}
}
fclose($f);
}
}
?>
<body>
<header><h1>Mapa da rede EM TESTE</h1></header>
<div class="topologia_rede">
<img class="img_topologia_rede" src="img/img_topologia.png">
</div>
<?php teste_ping('div_torre_band', 'www.google.com.br'); ?>
<?php teste_ping('div_fibra_1gb', 'www.googasle.com.br'); ?>
<?php teste_ping('div_telefonia_publica', 'www.google.com.br'); ?>
<?php teste_ping('div_e1_embratel', 'www.google.com.br'); ?>
<?php teste_ping('div_GRU', 'www.google.com.br'); ?>
<?php teste_ping('div_embratel_20mb', 'www.google.com.br'); ?>
<?php teste_ping('div_linktel_20mb', 'www.google.com.br'); ?>
<?php teste_ping('div_linktel_10mb', 'www.google.com.br'); ?>
<?php teste_ping('div_tvminuto_vl-mariana', 'www.google.com.br'); ?>
<?php teste_ping('div_link_2mb', 'www.google.com.br'); ?>
<?php teste_ping('div_radio_30mb', 'www.google.com.br'); ?>
<?php teste_ping('div_embratel_100mb', 'www.google.com.br'); ?>
<?php teste_ping('div_virtua_30mb', 'www.google.com.br'); ?>
<?php teste_ping('div_rede_publica', 'www.google.com.br'); ?>
<?php teste_ping('div_uol_diveo', 'www.google.com.br'); ?>
<?php teste_ping('div_oi_wifi', 'www.google.com.br'); ?>
<?php teste_ping('div_VCP', 'www.google.com.br'); ?>
</body>
</html>
Could you help me with how to solve it?
Obs1: I have already tried the browsers: Midori, Epiphany and Chromium and the problem persists;
Obs2: I have already updated apache, PHP5 and the service is OK;