如题:程序如下(这个是网上的),在windows下可以的,我的linux下web页面不行,另外,我试验了ifconfig,虽然可以出现信息,但是好多都丢失了,在windows上就不会出现这些问题。不知道是具体什么原因,求助
<?php
echo "<font color=\"red\"><blink><b>Pinging</b></blink></font><br>";
$to_ping = "www.baidu.com";
$count = 4;
$psize = 65;
echo " Please be patient, this can take a few moments...\n";
$co=0;
if(!exec("ping -c $count -s $psize $to_ping", $list1))
{
echo "right";
}
print_r($list1);
echo count($list1);
for ($i1=0;$i1 < count($list1);$i1++) {
echo $list1[$i1]."<br>";
}
system("ifconfig");
?> 在web页面运行该程序,list1是空的,没有结果,ifconfig会显示一部分结果,不完整;
Linux
<?php
echo "<font color=\"red\"><blink><b>Pinging</b></blink></font><br>";
$to_ping = "www.baidu.com";
$count = 4;
$psize = 65;
echo " Please be patient, this can take a few moments...\n";
$co=0;
if(!exec("ping -c $count -s $psize $to_ping", $list1))
{
echo "right";
}
print_r($list1);
echo count($list1);
for ($i1=0;$i1 < count($list1);$i1++) {
echo $list1[$i1]."<br>";
}
system("ifconfig");
?> 在web页面运行该程序,list1是空的,没有结果,ifconfig会显示一部分结果,不完整;
Linux
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货