如何使用来自Apache / PHP的葡萄酒? - “在/ var / WWW'是不是你拥有的 [英] How to use Wine from Apache/Php? - '/var/www' is not owned by you

查看:303
本文介绍了如何使用来自Apache / PHP的葡萄酒? - “在/ var / WWW'是不是你拥有的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的Debian服务器上运行PHP脚本中一个窗口的命令行工具。
对于这一点,我想酒。
调用的葡萄酒,并通过终端工具正常工作:$酒tool.exe

I need to run a windows command line tool from a php script on my Debian server. For that, I'm trying Wine. Invoking wine and the tool via terminal works fine: "$ wine tool.exe"

但是从我的PHP脚本运行同一时...

But when running the same from my php script...

EXEC(酒tool.exe);

exec("wine tool.exe");

...我得到了我的Apache的错误日志如下:
酒:在/ var / WWW不为你所拥有的,拒绝有创建一个配置目录

...I get the following in my Apache error log: wine: '/var/www' is not owned by you, refusing to create a configuration directory there

我想这是一个简单的基本的Linux用户权限的问题...
我应该改变对葡萄酒www数据的用户权限?怎么样?

I guess this is a simple fundamental linux user rights problem... Should I change the user rights for Wine to www-data? How?

推荐答案

您应该创建运行葡萄酒单独的主目录。创建一个由www数据拥有的目录,设置HOME变量,苏www数据,并运行winecfg,而后一次;然后运行tool.exe(作为用户)。在exec调用,确保HOME设置(试行 EXEC(HOME = / tmp目录/酒tool.exe)

You should create a separate home directory for running Wine. Create a directory which is owned by www-data, set the HOME variable, su www-data, and run winecfg once; then run tool.exe (as that user). In the exec call, make sure that HOME is set (try exec("HOME=/tmp/wine wine tool.exe"))

这篇关于如何使用来自Apache / PHP的葡萄酒? - “在/ var / WWW'是不是你拥有的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆