LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 06: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, 02:14 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
http://php.net/manual/en/function.exec.php
 
Old 02-22-2016, 06: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



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 03:58 AM
execute a linux command in the c program mja Linux - Software 2 01-25-2011 10:44 PM
[SOLVED] Awk: Input from one line, execute program; input from next line, execute program C.L. Programming 9 09-27-2010 12:06 AM
Execute Linux command with PHP jpostma Programming 2 06-01-2007 01:48 AM
PHP execute at command line gjmwalsh Mandriva 2 12-06-2003 01:03 AM

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

All times are GMT -5. The time now is 02:03 AM.

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