I'm trying to start vncviewer on Raspberry Pi using PHP, where RPi is the client and my VNC server runs MS Windows.
In PHP I'm using this script to start the vncviewer
$cmd="echo password | vncviewer -autopass " .$ip;
shell_exec($cmd);
It works when I only run the shell script from RPi, but when try it from PHP I get this error:
Error: Can't open display:
Is there any workaround for this error ?