脚本运行显示服务器超时,php脚本在服务器更新后给出超时或空白页面

我有一个脚本,可以计算生物节律并显示结果图。 对于我未知的原因,以下脚本在服务器更新后似乎无法工作。php脚本在服务器更新后给出超时或空白页面

$now = gmdate('D, d M Y H:i:s') . ' GMT';

header('Expires: ' . $now);

header('Last-Modified: ' . $now);

header("Cache-Control: no-store, no-cache, must-revalidate");

header("Pragma: no-cache");

error_reporting(0);

$copyright = "By www.magnaromagna.it";

$name = $_POST["name"];

$day = $_POST["day"];

$month = $_POST["month"];

$year = $_POST["year"];

$cycle = $_POST["cycle"];

$chartsize = $_POST["chartsize"];

$name = strip_tags($name);

if($chartsize == "small")

{

$chartwidth = 450;

$chartheight = 252;

$tablewidth = 500;

}

elseif($chartsize == "medium")

{

$chartwidth = 625;

$chartheight = 350;

$tablewidth = 655;

}

else

{

$chartwidth = 800;

$chartheight = 448;

$tablewidth = 820;

}

$date = date("m/d/y");

function drawRhythm($daysalive, $period, $color)

{

//$period = $period * 2;

global $cycle, $image, $chartwidth, $chartheight;

$centerday = $daysalive - ($cycle/2);

$plotscale = ($chartheight - 25)/2;

$plotcenter = ($chartheight - 25)/2;

// draw the curve

for($count = 0; $count <= $cycle; $count++ )

{

echo $date ;

$phase = ((($centerday) + $count) % $period)/$period * 2 * pi();

$y = 1 - sin($phase) * (float)$plotscale + (float)$plotcenter;

if($count > 0)

{

imageLine($image, $oldx, $oldy, $count * $chartwidth/$cycle, $y, $color);

}

$oldx = $count * $chartwidth/$cycle;

$oldy = $y;

}

}

$pastdays = abs(gregorianToJD($month, $day, $year) - gregorianToJD(date("m"), date("d"), date("Y")));

$image = imageCreate($chartwidth, $chartheight);

$colorbackground = imageColorAllocate($image, 0, 0, 0);

$colorforeground = imageColorAllocate($image, 255, 255, 255);

$colorgrid = imageColorAllocate($image, 255, 255, 255);

$colorborder = imageColorAllocate($image, 175, 175, 175);

$colorcross = imageColorAllocate($image, 255, 255, 255);

$colorphysical = imageColorAllocate($image, 0, 0, 255);

$coloremotional = imageColorAllocate($image, 255, 0, 0);

$colorintellectual = imageColorAllocate($image, 0, 255, 0);

$colorintuitive = imageColorAllocate($image, 255, 0, 255);

$colorawareness = imageColorAllocate($image, 255, 125, 0);

$colorspiritual = imageColorAllocate($image, 0, 255, 255);

$coloraesthetic = imageColorAllocate($image, 255, 255, 0);

imageFilledRectangle($image, 0, 0, $width - 1, $height - 1, $colorbackground);

$nrsecondsperday = 60 * 60 * 24;

// add a + before $nrsecondsperday; //

$diagramdate = time() - ($cycle/2 + $nrsecondsperday) * $nrsecondsperday;

$flagcount = 1;

for ($index = 1; $index < $cycle; $index )

{

$thisdate = getDate($diagramdate);

$countCoord = ($chartwidth/$cycle) * $index;

imageLine($image, $countCoord, $chartheight - 25, $countCoord, $chartheight - 20, $colorgrid);

$flag = $flagcount%2;

if($cycle == 60 && $flag == 0)

{

imageString($image, 3, $countCoord - 2, $chartheight - 16, $thisdate[ "mday"], $colorgrid);

}

elseif($cycle != 60)

{

imageString($image, 3, $countCoord - 5, $chartheight - 16, $thisdate[ "mday"], $colorgrid);

}

$flagcount ;

$diagramdate = $nrsecondsperday;

}

imageRectangle($image, 0, 0, $chartwidth - 1, $chartheight - 20, $colorborder);

imageLine($image, 0, ($chartheight - 20)/2, $chartwidth, ($chartheight - 20)/2, $colorcross);

imageLine($image, $chartwidth/2, 0, $chartwidth/2, $chartheight - 20, $colorcross);

drawRhythm($pastdays, 23, $colorphysical);

drawRhythm($pastdays, 28, $coloremotional);

drawRhythm($pastdays, 33, $colorintellectual);

drawRhythm($pastdays, 38, $colorintuitive);

drawRhythm($pastdays, 43, $coloraesthetic);

drawRhythm($pastdays, 48, $colorawareness);

drawRhythm($pastdays, 53, $colorspiritual);

$subnum = rand(0, 999999);

$subnum = "images/dummies/".$subnum.".gif";

imageGIF($image,$subnum);

imagedestroy($image);

?>

Risultato Bioritmo

if($name != "")

{

echo "Bioritmo per $name
";

}

else

{

echo "Mappa dei tuoi bioritmi
";

}

?>

echo "Nascita: $month/$day/$year
Data di oggi: $date";

?>

<?php%20echo%20">

Rosso: Ciclo Emozionale | 

Blu: Ciclo Fisico | 

Verde: Ciclo Intelligenza

Viola: Intuito | 

Acqua: Ciclo Spirituale | 

Giallo: Ciclo Estetico | 

Arancione:Ciclo Consapevolezza

Capire il tuo bioritmo

执行它后,会发生以下情况:

网关没有接收到来自上游服务器或应用程序

它的及时响应,要么或在脚本结果空白页。

我不认为服务器应该花这么多时间来执行这个脚本,但这又可能只是我的代码错误。

超时的一个例子是执行此: http://tuttoblog.com/bioritmo/(只需插入随机的名字和年份以及执行)

一个空白页面的一个例子是在这里执行: http://magnaromagna.it/bioritmo/(只插入一个随机的名称和年份然后执行)

由于时间相当短暂,对此事的任何帮助都将非常感激。

我的phpinfo - > magnaromagna.it/phpinfo.php

+0

尝试增加你的'max_execution_time' - 解决这个问题吗? –

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值