I'm running xubuntu 11.10. From php, I'm calling a shell that exports the display and then calls wmctrl. Every time I call wmctrl, I see an error "Cannot open display".
I call my shell from php:
$output = shell_exec('/var/www/wmctrl.sh');
My hostname is steven-Z-CLASS
Here is my shell script:
#!/bin/bash
export DISPLAY=steven-Z-CLASS:0.0
echo $DISPLAY
wmctrl -m
When I run this, I see the echoed display value in my php page:
steven-Z-CLASS:0.0
However, wmctl does not run. I see this error in the apache log:
Cannot open display.
Any ideas why wmctrl can't open the display?
On the
steven-Z-CLASS
system you'll need to runxhost +OTHERNAME
where "OTHERNAME" is the name of the system that is running the "wmctrl -m" command.The
xhost
command allows the user to modify the security on the local X11 server to allow "OTHERNAME" to connect and display graphics on it.DISPLAY=steven-Z-CLASS:0.0
means::
and dot)steven-Z-CLASS
Try removing
steven-Z-CLASS
if the machine running the PHP command is the same machine as the X server one: