In a PHP script running under nginx/php-fpm, I can execute any X program using this PHP code:

shell_exec("DISPLAY=:0 /usr/bin/nohup '{$command}' > /dev/null 2>&1 &");

This will open the X program on my desktop, and the PHP script will carry on and finish. The X program will stay open, even after the PHP script finishes.

It works for every single X program I've tried (including: mpv, kate, konsole, k3b and more) - but not Dolphin. When trying to run Dolphin this way it never even appears at all, and no errors appear on screen or in any logs I can find.

Is there something different about how Dolphin is executed that could be relevant here? Something to do with sockets/users/background processes or something like that?

I've checked the following already:

  • Tried using the binary name only (dolphin) and full path (/usr/bin/dolphin) - all other programs work with both anyway, so doesn't seem to be a $PATH issue
  • Executing the same command DISPLAY=:0 /usr/bin/nohup '{$command}' > /dev/null 2>&1 & in a Konsole shell works for everything, including Dolphin
  • There's nothing in the PHP error log, and I've got all error levels enabled
  • I've tried it both when other Dolphin windows are open, and when they're all closed (and confirmed there's no Dolphin processes still running)
  • Nothing in the Xorg log either

Alternatively maybe there's some similar but different PHP code that would work for Dolphin?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.