Forum Moderators: coopster

Message Too Old, No Replies

Querying a remote desktop server

         

frenetic

1:26 am on Apr 22, 2006 (gmt 0)

10+ Year Member



I've managed to get Ubuntu running locally and spitting out PNG webpage screenshots from Firefox via command line from a user logged-in to Gnome. My question now is: how can I query that from another server via PHP?

I'm really not sure where to even begin looking for the answer to this so I'm hoping someone can steer me in the right direction.

Is there a way I can put a PHP script on the local screenshot server to log in as the user and issue the correct commands and then query that remotely?

Thanks for any help you can provide...

hakre

4:04 pm on Apr 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi frentic,

welcome to webmaster world.

you can use php to execute other programms and you can even use it to be a script on the desktop or within the cli. please checkout the basic in the php manual because it differs from cgi or sapi usage.

anyway with the according userrights you should be able to do everything you want ;), but you need to know the commands to take the screenshot etc. .

if you want to write a client application that interacts with a server process via tcp/ip or udp, php might not be the weapon of choice.

frenetic

2:59 pm on Apr 27, 2006 (gmt 0)

10+ Year Member



Thanks for the reply. I guess user rights are what I don't understand.

Right now I have user "frenetic" who, when logged in, can run a script that takes a screenshot. Some of this is dependant on software that's installed in his account.

Can I have PHP run as the frenetic user and execute the necessary script?

Oh and if there's a better option than PHP I'd be happy to hear it. Though it seems like all I really want to do is trigger this script from a remote server and PHP would be up to that task were it not for it being an application that requires the desktop.

andye

3:08 pm on Apr 27, 2006 (gmt 0)

10+ Year Member



better option than PHP ... all I really want to do is trigger this script from a remote server

I don't fully understand what you're doing, to be honest, but maybe you should look at the rsh and rlogin commands?

hth, a.

jatar_k

4:18 pm on Apr 28, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



when you say trigger do you need any info/values/pics returned?

you could just trigger it using a regular old web request or maybe curl or a socket to a certain port if 80 isn't open, not sure.

there are ways of doing it

when you do it now, how do you do it?