LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Tags used in this thread
Popular LQ Tags ,

Reply
 
Thread Tools
Old 09-19-2009, 04:08 AM   #1
ovidiupys
LQ Newbie
 
Registered: Sep 2006
Posts: 2
Thanked: 0
screen and php


[Log in to get rid of this advertisement]
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.
windows_xp_2003 ovidiupys is offline  
Tag This Post ,
Reply With Quote
Old 09-19-2009, 05:30 AM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835
Thanked: 136
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.
linuxfedora lutusp is offline     Reply With Quote
Old 09-19-2009, 05:31 AM   #3
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 205
Thanked: 14
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.
linuxcentos carltm is offline     Reply With Quote
Old 09-19-2009, 11:14 AM   #4
ovidiupys
LQ Newbie
 
Registered: Sep 2006
Posts: 2
Thanked: 0

Original Poster
Thanks a lot @carltm. That is exactly what I need.
windows_xp_2003 ovidiupys is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 04:13 PM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration