duanmu3049 2016-04-04 17:29
浏览 28
已采纳

从客户端接收URL后打开服务器上的浏览器

Using a Raspberry Pi, I have created a web-server.

End goal: The web-page prompts the user for the URL, the URL is sent from the client to the server, and the URL is opened in the Raspberry Pi's browser: Epiphany.

As of now, I have a basic form for the URL on the web-page, and once the submit button is pressed, the server uses PHP to read the input.

How can I open a webpage on the server, Raspberry Pi, with that URL?

Update: Forgot to mention, the Raspberry Pi is running Raspbian.

  • 写回答

1条回答 默认 最新

  • dongyu2047 2016-04-04 21:58
    关注

    This sounds like an X11 display problem.

    Using shell_exec, have your web server show the value of the DISPLAY environment variable. If it's not set, you'll need to set it (probably to :1.0).

    You may also need to use xhost + to grant permission to the root user (assuming the web server is running as root).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 c语言,请帮蒟蒻看一个题
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)