1

I have the following bash script:

#!/bin/bash
export DISPLAY=:0.0
chromium-browser --incognito --kiosk https://www.google.de/

If I run it from terminal ./start_chromium.sh Chromium opens as expected.

Now I want to run this script using exec() in a PHP-file:

<?php
   exec('/home/pi/start_chromium.sh');
?>

Unfortunately nothing happens.

Checking the error log of Apache2, I see the following error message:

(chromium-browser-v7:1992): Gtk-WARNING **: 09:33:27.850: cannot open display: :0.0

Can anybody help me?

Thanks in advance. Regards Lars

1 Answer 1

1

This may be an Xauth issue. To test, you can run (from your terminal)

DISPLAY=:0.0 ; xhosts +

This is not a recommended long term fix as it completely disabled access control to your X server.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.