$output

PHP - How to run google chrome from PHP script

Here is my code:

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

      

This is what I have in test.sh:

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

      

When I execute ./test.sh

, google-chrome starts up and then I see text in my terminal Starting Chrome

.

However, when I execute the php script, I only see text Starting Chrome

. Why google chrome won't start when test.sh

apache2 is called?

I think there is something about the permissions.

Is it possible to somehow achieve such a thing?

+3


source to share





All Articles