3

Here is my code:

<?php
$output = exec('/bin/bash /var/www/html/test.sh');
echo "<pre>$output</pre>";
?>

Here is what i have in test.sh:

#!/bin/bash
export DISPLAY=:0
google-chrome
echo "Starting Chrome"

When i execute ./test.sh google-chrome is started and then i see in my terminal the text Starting Chrome.

However when i execute the php script i see only the text Starting Chrome. Why google-chrome does not start when the test.sh is called by apache2 ?

I think there is something regarding permissions.

Is it even possible to achieve such thing somehow ?

Venelin
  • 2,905
  • 7
  • 53
  • 117

0 Answers0