好吧,這裏的問題。此代碼工作在本地主機上,但不能在活動網站PHP - 代碼工作在本地主機上,但不能在活動網站
<?php
session_start();
header('Content-type: image/jpeg');
$text = $_SESSION['secure'];
$font_size = 30;
$image_width = 120;
$image_height = 40;
$image = imagecreate($image_width, $image_height);
imagecolorallocate($image, 255, 255, 255);
$text_color = imagecolorallocate($image, 0, 0, 0);
$line_color = imagecolorallocate($image, 0, 0, 0);
for($x=1; $x<=30; $x++){
$x1 = rand(1, 100);
$y1 = rand(1, 100);
$x2 = rand(1, 100);
$y2 = rand(1, 100);
imageline($image, $x1, $y1, $x2, $y2, $line_color);
}
imagettftext($image, $font_size, 0, 15, 30, $text_color, 'font2.ttf', $text);
imagejpeg($image);
?>
本地主機和主機商都運行相同的PHP版本
看看這幅畫你張貼任何之前,請!:
http://s2.postimg.org/etamdsk95/help_me.png
問題與PHP擴展;) – Hackerman
發表您的php.ini – Joren
的內容已在遠程服務器上得到了安裝並啓用了GD擴展? – Gavin