Launching an X application from a locally running Apache web server using PHP

后端 未结 1 1569
萌比男神i
萌比男神i 2021-01-21 14:15

I have Apache and PHP running on my local Linux desktop. My PHP script launches \"xcalc\", and looks like this:


         


        
1条回答
  •  梦谈多话
    2021-01-21 14:50

    xcalc needs either a -display option or the DISPLAY environment variable set to know which X server to display on. When you run it from the shell, it's probably picking up $DISPLAY from your shell environment, but the Apache web server normally won't have that set.

    You may also run into X authentication issues, if the X session isn't being run by the same user as the Apache web server, since X normally relies on a shared secret (the “magic cookie”) stored in the $HOME/.xauthority file of the user who logged into the X session.

    0 讨论(0)
提交回复
热议问题