2012-01-03 13 views
0

私は次のコードを使用しています:私はWindows 7の 約1つの詳細にinstaled 2.7のver apatchを使用していますGD2 imagegrabscreen fatal error?

Fatal error: Call to undefined function: imagegrabscreen() in c:\usr\krasnal\www\testy marcina\index.php on line 2

:私はこれを取得結果として

<?php 
$im = imagegrabscreen(); 
imagepng($im, "myscreenshot.png"); 
imagedestroy($im); 
?> 

そして私をGD:

GD Version: bundled (2.0.28 compatible)

FreeType Support: yes

FreeType Linkage: with freetype

T1Lib Support: no

GIF Read Support: yes

GIF Create Support: yes JPG Support: yes

PNG Support: yes

WBMP Support: yes

XBM Support: yes

JIS-mapped Japanese Font Support: no

何が問題なのですか。

+0

PHPのバージョンは何? – julio

答えて

1

あなたは、少なくともPHP 5.2.2以降が必要、とphp_gd2.dllをここ

がサーバー上でテストするためのコードスニペットです:https://stackoverflow.com/a/4526834/1093649

そして、あなたは空白の画面を取得する場合、をご確認ください。 Apacheサービス特権のようなものはphp manual page commentに記載されています。

+0

これはLinuxベースのサーバーでも機能しますか? – Starx

2

また:

For this to work your Apache service must be set to 'Allow service to interact with desktop' otherwise you will just get a blank image. To fix this right-click My Computer, select Manage/Services and Applications/Services - find the apache service (like Apache2) and right-click, select Properties - choose the Log on tab and check the 'Allow service to interact with desktop' checkbox. Restart Apache.

+0

まだ「黒いイメージ」ですか? –

関連する問題