LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-21-2016, 07:55 PM   #1
shehzaad
LQ Newbie
 
Registered: Feb 2016
Posts: 1

Rep: Reputation: Disabled
how to take input from php and execute it in a command-line program in terminal linux


i cant take an input enter by a user to load the input in a Linux terminal to execute it in a command line program...can you help please...for example when a user enter a value and press enter in must open terminal in the background and take the input and execute it in a command line program
 
Old 02-22-2016, 03:14 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,128

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
http://php.net/manual/en/function.exec.php
 
Old 02-22-2016, 07:10 AM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
As TenTenths mentions you can use php functions like exec or passthru to execute programs. But keep in mind that PHP will execute these programs as webuser (maybe "nobody", "wwwrun" or such), means a user that is strongly restricted...
 
  


Reply


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
Is there any way to execute a program which needs some input through a php web page?? maradnus Programming 1 12-07-2011 04:58 AM
execute a linux command in the c program mja Linux - Software 2 01-25-2011 11:44 PM
[SOLVED] Awk: Input from one line, execute program; input from next line, execute program C.L. Programming 9 09-27-2010 01:06 AM
Execute Linux command with PHP jpostma Programming 2 06-01-2007 02:48 AM
PHP execute at command line gjmwalsh Mandriva 2 12-06-2003 02:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:47 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
Open Source Consulting | Domain Registration