Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Webserver permissions
PostPosted: Fri Feb 12, 2010 9:57 am 
Offline
Newbie

Joined: Thu Dec 03, 2009 3:24 am
Posts: 4
Hello.

I've been looking for this for a long time. I'm newbie at linux, so I try to say everything I did.

I have setup Xvfb, and with root account I have run:
Code:
Xvfb :1 &


So that I have a X server for using wine.
I have setup wine and I want to run a command that looks like this:

in shell (with putty)
Code:
DISPLAY=:1 wine c:\\program.exe -file test.ext


and all works fine.

All I need is to run this command with php. I started testing this in php script like:
Code:
<?php

$output = shell_exec('DISPLAY=:1 wine c:\\\\program.exe -file test.ext');
echo $output;

?>


This gives me a blank screen, no output, no error.
even shell_exec('DISPLAY=:1 wine c:\\program.exe -file test.ext'); (exact same line as shell) shows no output.
However this:
shell_exec('DISPLAY=:1 wine /root/.wine/drive_c/program.exe -file test.ext');

Will successfully run the program.exe and in the output, program.exe is telling me that it can't create its temp file, so the whole process fails.

I don't know what kind of a permission is this that I can run wine successfully and wine can run the program.exe, but the program.exe can't create its needed file or lets says access to other files on the system for its needs. (Note that the whole thing perfectly works if I run the command directly in shell)

I have tried:
Code:
chmod 777 -R .wine

or
Code:
chown www-data .wine -R

no success.

Someone told me it is Apparmor that overrides directory permissions. But before disabling or doing anything to that, I decided to start this topic to do what is best.
Please help!
Thanks for your time.

Just a side note, maybe to help:
Shell_exec('env'); in php and 'env' directly in shell gives me same variables but these:

PWD in shell is /root, with php is the document root of my site.
HOME in shell is /root, with php is /var/www
PATH in shell is /usr/lib/kde4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin but in php it is /sbin:/usr/sbin:/bin:/usr/bin

Another vairable in shell is:
_=/usr/bin/env
in php:
_=/etc/init.d/php-fastcgi

(USERNAME in php is root too)

I tried to set them to what it is with shell by putenv() function in php, but still no success.

I have:
Ubunto 8.04
Wine 1.1.37
Nginx as webserver
PHP5


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group