I installed wine on Debian 8 64 bit. I logged as user `tom` to SSH and I can windows console applications just fine from this location:
Code: Select all
/home/tom/domains/mydomain.com/public_html/
However then I made a PHP script put in on domain owned by `tom`:
and visites the page in a browser. And wine doesn't work from PHP. It just shows this:
Code: Select all
wine: chdir to /.wine
: No such file or directory
The PHP code is just:
I am running Apache webserver. I am not sure which user is the Apache running as. When I put a PHP script on domain owned by `tom` and put there code:
Code: Select all
file_put_contents('test.txt', 'Hello');
it creates test.txt in:
Code: Select all
/home/tom/domains/mydomain.com/public_html/
and this new file is owned by `tom`. So I guess Apache is running PHP scripts as the user who owns the domain.
I tried running wine from PHP with full paths, like this:
Code: Select all
/usr/bin/wine /home/tom/domains/mydomain.com/public_html/application.exe
but this gives exactly same error:
Code: Select all
wine: chdir to /.wine
: No such file or directory
There is .wine directory under:
Code: Select all
/home/tom/domains/mydomain.com/public_html/
So I guess that Apache is not really running scripts as `tom` but instead some other user and .wine directory must be placed in home directory of this other user. But which user should it be?