Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to send input to a screen session from php. So far I have followed the steps explained here
Is running GNU Screen suid root the only way to make multiuser mode work?

And I have set "multiuser on" and "acladd www-data" in the screenrc file (or well, no. in another file that I use by the -c option but still)

My problem now is that whenever i try to acess screen by php

exec('screen -S user/session -p 0 -X stuff "test"'."\n", $ret);  

I get the error:

Cannot opendir /var/run/screen/S-user: Permission denied
share|improve this question

migrated from stackoverflow.com Nov 1 '12 at 9:22

This question came from our site for professional and enthusiast programmers.

    
I have no idea why a question about using php belongs on this site rather than stackoverflow.. but apparently it does –  Zlug Nov 1 '12 at 10:23
    
You're doing it wrong. ...that aside, maybe you will find this useful: unix.stackexchange.com/questions/2523/… –  Ярослав Рахматуллин Nov 1 '12 at 12:09
    
I unfortunately didn't –  Zlug Nov 1 '12 at 12:29
add comment

1 Answer 1

Permissions, Permissions, Permissions

The user that is running the PHP Interpreter does not have the required permissions to access the screen session that you have running.

You have given the user www-data permission to use the screen, however, access to the screen file is denied. Try and modify the permissions for the file to allow the www-data user to read/write.

share|improve this answer
    
I figured that much, what I didn't figured was how to give it, if the dir itself has any other permission than 700 screen won't run –  Zlug Nov 1 '12 at 7:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.