LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2009, 04:08 AM   #1
ovidiupys
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Rep: Reputation: 0
screen and php


Hi there all.
I try to create and attatch to a screen session via php.
When I type
Code:
screen -q
in the terminal it creates a new screen, but when i try to do it via php with
Code:
system("screen -q")
or shell_exec("screen -q"), it fails and tells me this : "Must be connected to a terminal".

Is it possible to be done ?

Thank you.
 
Old 09-19-2009, 05:30 AM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by ovidiupys View Post
Hi there all.
I try to create and attatch to a screen session via php.
When I type
Code:
screen -q
in the terminal it creates a new screen, but when i try to do it via php with
Code:
system("screen -q")
or shell_exec("screen -q"), it fails and tells me this : "Must be connected to a terminal".

Is it possible to be done ?

Thank you.
Yes, it is. But you must be connected to a terminal. This is an important security precaution.
 
Old 09-19-2009, 05:31 AM   #3
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 97
screen is an interactive program which requires a tty. Although php
can be run interactively, I'll bet you're not using it that way.

If you are trying to run commands interactively without using a tty,
look at expect. You can use it to create an interactive connection
from within a script.
 
Old 09-19-2009, 11:14 AM   #4
ovidiupys
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks a lot @carltm. That is exactly what I need.
 
  


Reply

Tags
php, screen


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php not working Fedora 2 (blank screen) jomama Programming 2 08-27-2004 03:33 PM
php not working Fedora 2 (blank screen) jomama Linux - Software 1 08-27-2004 11:42 AM
horde screen blank, test.php says gettext = no posixjunkie Linux - Software 1 06-21-2004 10:49 PM
php include not working just dumping txt to screen timc3 Linux - Software 0 10-07-2003 06:46 PM
Size of the client's screen with PHP ??? gluon Programming 2 09-29-2002 05:24 PM


All times are GMT -5. The time now is 11:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration