Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

imagegrabscreen() problems

279 views
Skip to first unread message

tony23

unread,
Jan 17, 2010, 3:40:26 PM1/17/10
to
Running WAMPServer2 - local dev machine uses Windows XP, Server is
Windows 2003 Server

On my local dev, everything works fine. On the server, I get a black
screen. I have spent hours trying to figure this out, but no luck. I
HAVE checked the "Allow service to interact with desktop", on both
systems.

Here is the code:

<?PHP
header('Content-type: image/jpeg');
$im = imagegrabscreen();
imagejpeg($im);
?>

Anyone have any other ideas about this? TIA!

The Natural Philosopher

unread,
Jan 17, 2010, 3:45:29 PM1/17/10
to

tony23

unread,
Jan 17, 2010, 4:03:41 PM1/17/10
to
On Jan 17, 3:45 pm, The Natural Philosopher <t...@invalid.invalid>
wrote:

Sorry, I don't understand what you're getting at. There is no useful
information addressing my problem there.

If I use EXACTLY the code in the example, I get a black PNG.

I've already stated that I HAVE checked "Allow service to interact
with desktop".

Jerry Stuckle

unread,
Jan 17, 2010, 4:14:58 PM1/17/10
to

PHP runs on the server, and cannot grab a screen on your client.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

tony23

unread,
Jan 17, 2010, 4:34:21 PM1/17/10
to
On Jan 17, 4:14 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> tony23 wrote:
> > Running WAMPServer2 - local dev machine uses Windows XP, Server is
> > Windows 2003 Server
>
> > On my local dev, everything works fine. On the server, I get a black
> > screen. I have spent hours trying to figure this out, but no luck. I
> > HAVE checked the "Allow service to interact with desktop", on both
> > systems.
>
> > Here is the code:
>
> > <?PHP
> > header('Content-type: image/jpeg');
> > $im = imagegrabscreen();
> > imagejpeg($im);
> > ?>
>
> > Anyone have any other ideas about this? TIA!
>
> PHP runs on the server, and cannot grab a screen on your client.

Yes, I understand this.

I'm not trying to grab a screen on my client. I am EXPECTING a
screenshot from the SERVER.

When I run on my dev machine, using localhost, the above code works
fine. It grabs a screenshot of the local system, as it should.

When I run on my SERVER, I get a black image. This happens whether I
access the script remotely via HTTP, or if I use Remote Desktop, log
in, and access it via localhost.

I have exactly the same problem with imagegrabwindow, too.

I'm trying to determine why the server won't deliver anything but a
black image, whether using imagegrabscreen or imagegrabwindow.

The Natural Philosopher

unread,
Jan 17, 2010, 4:45:40 PM1/17/10
to

is the server equipped with a screen?

tony23

unread,
Jan 17, 2010, 5:06:51 PM1/17/10
to
On Jan 17, 4:45 pm, The Natural Philosopher <t...@invalid.invalid>

Yeah - I just had one of the techs go hook up directly to the server
and it works fine that way. And while that session is logged in, it
seems everything works fine remotely, too, both with remote desktop
and via http.

Not sure how well that's going to work long-term, though. :(

Jerry Stuckle

unread,
Jan 17, 2010, 7:29:50 PM1/17/10
to

What does the server have on it's screen?

"Álvaro G. Vicario"

unread,
Jan 18, 2010, 3:30:33 AM1/18/10
to
El 17/01/2010 21:40, tony23 escribi�:

Does it work as expected if you start Apache with a regular user rather
that "Local System"?

--
-- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programaci�n web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Message has been deleted

Captain Paralytic

unread,
Jan 18, 2010, 5:30:29 AM1/18/10
to
On 17 Jan, 22:06, tony23 <23.t...@gmail.com> wrote:
> > is the server equipped with a screen?
>
> Yeah - I just had one of the techs go hook up directly to the server
> and it works fine that way. And while that session is logged in, it
> seems everything works fine remotely, too, both with remote desktop
> and via http.
I think you have your answer right there. Without anyone logged in,
there is no "screen" to work with.

"Álvaro G. Vicario"

unread,
Jan 18, 2010, 5:30:40 AM1/18/10
to
El 18/01/2010 10:36, Danny Wilkerson escribi�:
> Only works on a windows systems from what i understand. Maybe that's
> the issue.

As far as I know, "Windows 2003 Server" is a platform that fulfils that
requirement ;-)

0 new messages