LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-01-2007, 01:05 AM   #1
jpostma
Member
 
Registered: Jun 2003
Location: Alphen ad Rijn -- The Netherlands
Distribution: Fedora Core 2 - Slackware 12
Posts: 119

Rep: Reputation: 15
Execute Linux command with PHP


Is it possible to execute a Linux command with PHP? For example 'cat file1.txt >> file2.txt'.

Johannes
 
Old 06-01-2007, 01:38 AM   #2
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
look up the system() command in php.


i think it would be

<?php
*/ use the full path /*
system(`cat /root/file1.txt >> /root/file2.txt', $retval);
printf "$retval"

?>

Last edited by slimm609; 06-01-2007 at 01:39 AM.
 
Old 06-01-2007, 01:48 AM   #3
mssanchu
LQ Newbie
 
Registered: Dec 2004
Location: India
Distribution: Redhat, Gentoo
Posts: 18

Rep: Reputation: 0
sure hope this shud help....

http://www.phpfreaks.com/phpmanual/p...tion.exec.html


try google for more related help links...
 
  


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
Execute shell script using php on linux vj123 Programming 2 02-21-2006 12:41 AM
PHP can't execute shell command ! rome Programming 3 11-15-2005 12:46 PM
PHP can't execute shell command ! rome Programming 1 11-15-2005 09:12 AM
execute php file on command prompt robberttheman Linux - Newbie 0 09-23-2004 01:24 PM
PHP execute at command line gjmwalsh Mandriva 2 12-06-2003 01:03 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:42 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