如何通过后台运行的Perl脚本触发apache用户启动Linux中的XServer?

发布于 2024-08-25 10:04:13 字数 341 浏览 5 评论 0原文

的 Perl 脚本通过 WINE 启动 MS Office

我正在尝试使用由 apache 托管并由其他应用程序触发 。我在日志文件中收到以下错误消息

“应用程序尝试创建窗口,但无法加载驱动程序。 确保您的 X 服务器正在运行并且 $DISPLAY 设置正确”

如果我使用 root 用户直接在 shell 提示符下运行脚本,那么 WINE 会

正确启动 XServer 并执行 MS MSoffice,如果我设置了 xhost +local:apache 在 shell 提示符下也可以正常工作

我如何从 apache 用户启动 XServer?

I am trying to launch MS Office through WINE using a Perl script hosted by apache

and and triggered by other application. I am getting the following error message in

log files "Application trying to create a window but no driver could not be loaded.
Make sure that your X server is running and that $DISPLAY is set correctly"
.

If I run the script directly on shell prompt using root user then WINE starts

XServer properly and execute MS MSoffice in addition to that if I set xhost +local:apache on shell prompt then also it works fine.

How can I start the XServer from apache user?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋叶绚丽 2024-09-01 10:04:13

每个 httpd 工作线程启动一个 X 服务器是一个极其糟糕的主意。如果您坚持这样做,请使用 Xvfb

我的建议是让一个单独的守护进程处理文档转换/创建,并使用消息队列来传递作业。

It is an exceedingly bad idea to start a X server per httpd worker. If you insist on doing this though, use Xvfb.

My recommendation would be to have a separate daemon handle the document conversion/creation, and use a message queue to pass it jobs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文