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:
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?