0
안녕하세요, 저는 제 웹 사이트에 PHP 서버 상태 스크립트를 추가하여 잘 작동하고있었습니다. 오늘까지 작동이 멈췄습니다. 코드를 살펴본 결과 아무 것도 변경되지 않았습니다. 내 문제는 이미지에 텍스트를 추가하지 않는다는 것입니다.PHP 서버 상태 이미지
다음<?php
$im = imagecreatefrompng('../images/status.png');
if($im)
{
//colors
$black = imagecolorallocate($im, 0,0,0);
// Replace path by your own font path
$font = 'Arial Bold.ttf';
$font2 = 'Arial.ttf';
// Add server name text
imagettftext($im, 10, 0, 10, 20, $black, $font, $name);
// Add server status text
imagettftext($im, 10, 0, 10, 50, $black, $font, "Server Status: ");
imagettftext($im, 10, 0, 105, 50, $color, $font, $text);
// Add gamemode status text
imagettftext($im, 10, 0, 10, 70, $black, $font, "Gamemode: ");
imagettftext($im, 10, 0, 95, 70, $color, $font, $gamemode);
// Add IP/PORT text
imagettftext($im, 10, 0, 10, 90, $black, $font, "IP: ");
imagettftext($im, 10, 0, 30, 90, $color, $font, $ip);
imagettftext($im, 10, 0, 10, 110, $black, $font, "Port: ");
imagettftext($im, 10, 0, 45, 110, $color, $font, $port);
imagepng($im);
}
?>
지금의로 (작동하지 않는)의 출력입니다 :
다음은 이미지를 생성하고 기본 이미지에 텍스트를 추가 내 코드입니다. 추가되는 텍스트가 누락되었습니다.http://screensnapr.com/e/WK9Kyp.png
나는 내가 이전에 근무 권리로 모든 일을했다고 가정합니다. 어떤 도움을 주셔서 감사합니다.감사합니다.
여기서'header ("Content-type : image/png"); –