You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, May 30th 2007, 10:07pm

[SOLVED] DCOP PHP script

Before i get blasted for asking this question (and if it already exist) - i searched the forums.

I have a PHP script that creates everything needed to get a remote desktop going in the java VncViewer.
Everything is working fine except for the last part.

The last part of the "script" is to call on Konqueror. I did finally figure out how to surpress the messages in the console so the PHP could continue without hanging when started

Source code

1
konqueror https://localhost/ </dev/null &>/tmp/wwwrun-vnc/text$pid_ident -display :$pid_ident &


Now, all the processes are run as wwwrun ( i know, not good ) and everything starts, but i get this error message :

cannot read network list kde from /root/.DCOP-XXX
...when i log into the remote desktop.

The thing is, it's being run as wwwrun - and if i log into the normal desktop as wwwrun, it all works fine.

If i send Konqueror to the disaply

Source code

1
konqueror -geometry 800x600-0-0 -display :2


It works fine. But if i run the command above in the php script, it seems to want the /root/.DCOP-XX information.

What am i doing wrong?

Thanks in advanced.

This post has been edited 1 times, last edit by "Phorem" (May 31st 2007, 3:42am)


2

Thursday, May 31st 2007, 3:42am

After looking at it from a different angle, i figured out the problem.
I was doing the commands like this:

PHP Source code

1
2
3
$run_homeshell_exec("export HOME=/var/lib/wwwrun");
$run_kdehomeshell_exec("export KDEHOME=/var/lib/wwwrun/.kde");
$run_kde shell_exec("konqueror https://localhost/ </dev/null &>/tmp/text$pid_ident -display :$pid_ident -geometry 800x600-0-0 &");


If you haven't noticed, when i use

PHP Source code

1
 shell_exec 
and export the home variables, i am doing it for EACH of the shells i just created! :rolleyes:

So, when i realized that, i wrote it as such:

PHP Source code

1
$run_kde shell_exec("export HOME=/var/lib/wwwrun; export KDEHOME=/var/lib/wwwrun/.kde; export DISPLAY=localhost:$pid_ident; konqueror https://localhost/ </dev/null &>/tmp/text$pid_ident -display :$pid_ident -geometry 800x600-0-0 &");


It all works as expected now. :-)