Running wine with php

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
damarist
Newbie
Newbie
Posts: 4
Joined: Tue Jan 13, 2015 11:49 pm

Running wine with php

Post by damarist »

Hey guys,

I am trying to run Wine from PHP to execute my custom cmd application.
It worked fine via ssh root but not on PHP.



Ok first I changed the owner for wine to www-data.

Code: Select all

sudo chown -R www-data:www-data .wine
Then I specified the wineprefix to my executive webspace.

Code: Select all

putenv("WINEPREFIX=/var/www/clients/client0/web5/web/");
Now I've tested wine from my webspace and it shows me the version

Code: Select all

$test = exec('wine --version');
echo $test;
But if I try to run my test.exe it won't work:

Code: Select all

 $test = exec('wine /var/www/clients/client0/web5/web/test.exe -b test.png');
Can someone tell me what I did wrong ?

Cheers
damarist
Newbie
Newbie
Posts: 4
Joined: Tue Jan 13, 2015 11:49 pm

Re: Running wine with php

Post by damarist »

Ok, i created a helloworld.exe now to test the path and it works perfectly without to enter the complete path:

Code: Select all

exec('wine helloworld.exe');
But it still won't work.
So the problem must be the attribute or the PNG file that I'll need to run with the exe.

Code: Select all

exec('wine test.exe -b test.png');
Has anyone an idea ?

Cheers
damarist
Newbie
Newbie
Posts: 4
Joined: Tue Jan 13, 2015 11:49 pm

Re: Running wine with php

Post by damarist »

I've tried about 100 versions to get the program parameters to work but nothing works.

I also tried to run it via cmd

Code: Select all

exec('wine cmd /C test.exe test.png');
It runs the program but not the attribute.

Please help me
damarist
Newbie
Newbie
Posts: 4
Joined: Tue Jan 13, 2015 11:49 pm

Re: Running wine with php

Post by damarist »

No one ?
Locked