[Wine]Running wine from php pages

André Carvalho acarvalho at abordo.com.br
Fri Jun 10 09:29:50 CDT 2005

Hi Eric,

I had a similar problem, I found out that even if the program doesn't 
display anything, Wine needs an X server.
So instead of having an X server running on the web server just for 
that, I decided to use the program Xvfb that comes with Xfree.
It's a dummy Xserver that can be used for testing and worked for me to 
run windows applications via wine on the web server.
Just start during boot:

Xvfb :1 &

When you want to run the application, on your test.sh don't forget to 
set the DISPLAY variable to :1  and that the apache user must have write 
permissions on the directory.

export DISPLAY=:1

Hope this helps,

By the way, remember that when you run wine from the web server, you 
have to have wine setup for that user because it will be executed as the 
apache user or whatever is configured there.

André Carvalho

Eric Yu-Wei Sung escreveu:

> In a Readhat 9 system, I have a simple php file "test.php" with the 
> following content to generate Setup.exe:
> <?php
>   echo exec("pwd");
>   exec('/usr/bin/wine rar a -a -c- -cfg- -k -m4 
> -zc:\\\\zipper\\\\Setup.cmt -sfx Setup.exe @c:\\\\zipper\\\\Setup.lst ');
> ?>
> When I run it as a CGI script via command line as "php test.php" . The 
> .exe is successfully generated. However, if I load test.php from the 
> browser, the result of "pwd" is shown on the browser but the Setup.exe 
> is not generated at all. I also tried embeded the above wine command 
> inside a shell script test.sh and call the script from the php page, 
> for example:
> <?php
>   exec("./test.sh");
> ?>
> but again, the wine command does not produce Setup.exe if test.php is 
> loaded from a browser.
> Any idea why?
> Thanks
> Eric
> _______________________________________________
> wine-users mailing list
> wine-users at winehq.org
> http://www.winehq.org/mailman/listinfo/wine-users

More information about the wine-users mailing list