Jump to content

exec() open application for local user


m3bik

Recommended Posts

I'm working on a light use/kiosk system. I have apache2 and php5 installed on Ubuntu 10.04 and I have the browser open the localhost web page by default. I would like to include a link on this page to open oowriter (open office writer) for the end user on the machine.

 

I've tried

 

exec('oowriter');

 

with no luck. I've also tried setting the DISPLAY value before the command like

 

exec('DISPLAY=:0 oowriter');

 

with no success. I don't mind have the www-data user in the sudoers file if I have to sudo the command or something, but is this possible to do?? I'm not having any luck at all!

Link to comment
Share on other sites

Well I've verified that the error reporting is turned on, but I don't actually get any errors when loading the webpage..

 

I have tried adding the www-data to the video group with no luck. I've also tried adding the www-data user to the user group running on the desktop, but still nothing.

 

I do have success running "php ./myfile.php" in the command line. It does open the application on the local user's screen.. but for some reason when I access the page on the web, I get nothing :(

Link to comment
Share on other sites

I wouldn't be running oowritter as root. You've just opened a massive security hole. There is nothing stoping anyone editing any file on the system as root.

 

You need to find out exactly what group www-data needs to be in and add them to it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.