HI All
I would like to launch a X11 application from Firefox HTML page.
I have
<?php
if (isset($_GET['run']) && $_GET['run'] == 'true') {
//This code will run if ?run=true is set.
echo "begin<br>";
$olddir = getcwd();
putenv('DISPLAY=localhost:12.0');
putenv('XDG_SESSION_ID=6');
putenv('XDG_SESSION_TYPE=tty');
putenv('SSH_CONNECTION=192.168.132.1 65372 192.168.132.132 22');
putenv('XDG_RUNTIME_DIR=/run/user/1000');
putenv('LOGNAME=kamgas');
putenv('XDG_SESSION_CLASS=user');
putenv('USER=kamgas');
putenv('TERM=xterm');
chdir('/var/www/html');
exec(xclock, $output, $status);
chdir($olddir);
var_dump($status);
var_dump($output);
echo '<br>end';
}
?>
<!-- This link will add ?run=true to your URL, myfilename.php?run=true -->
<a href="?run=true">Click Me!</a>
Unfortunately I have the following error
[Mon Feb 08 18:48:18.817970 2021] [php7:warn] [pid 905] [client 127.0.0.1:39156] PHP Warning: Use of undefined constant xclock - assumed 'xclock' (this will throw an Error in a future version of PHP) in /var/www/html/mons.php on line 16, referer:
http://localhost/mons.php?run=true
PuTTY X11 proxy: Unsupported authorisation protocol
Error: Can't open display: localhost:12.0
Your help is asked.
Thanks in advance.