Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,253
Total Threads: 80,789
Total Posts: 566,436
There are 64 users currently browsing (tf).
  Our Partners:
  TalkFreelance     Design and Development     Programming :

How to call Linux command within PHP?

Thread title: How to call Linux command within PHP?
    Thread tools Search this thread Display Modes  
05-30-2012, 11:16 AM
hirephp is offline hirephp
Status: On Vacation
Join date: Jun 2011
Posts: 1
iTrader: 0 / 0%

hirephp is on a distinguished road

Send a message via ICQ to hirephp Send a message via Yahoo to hirephp Send a message via Skype™ to hirephp

  Old  How to call Linux command within PHP?

How to call Linux command within PHP?

05-30-2012, 01:30 PM
Ant is offline Ant
Status: Member
Join date: Apr 2005
Location: England
Posts: 209
iTrader: 5 / 100%

Ant is on a distinguished road


You can use backticks in php to run bash commands, if that's what you mean?

`touch filename`
This thread might help further:

05-30-2012, 01:59 PM
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
iTrader: 18 / 100%

Village Genius will become famous soon enough


The PHP function exec will run it, the command will be subject to the user PHP is running as.

05-30-2012, 04:13 PM
.Nick is offline .Nick
.Nick's Avatar
Status: Request a custom title
Join date: Feb 2005
Posts: 1,159
iTrader: 3 / 100%

.Nick is on a distinguished road


If the command you run will depend in any way on user input, don't forget to run it through escapeshellcmd() or each argument individually through escapeshellarg().


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed