PHP and Shell Commands

Reply

Join Date: Jan 2008
Posts: 19
Reputation: Morty222 is an unknown quantity at this point 
Solved Threads: 0
Morty222 Morty222 is offline Offline
Newbie Poster

PHP and Shell Commands

 
0
  #1
Aug 12th, 2008
Can anyone tell me how to write a PHP script to update this shell command?

/usr/local/psa/bin/domain.sh -u domain.com -passwd password

I am trying to update FTP passwords using a PHP script, in place of logging into Plesk everyday to change an FTP password. I have a web based tool that holds all my customers FTP info (UN, PW, etc...). I want to update my tool, then have it update the Plesk FTP password automatically using a PHP script with a shell command.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 381
Reputation: langsor is an unknown quantity at this point 
Solved Threads: 33
langsor langsor is offline Offline
Posting Whiz

Re: PHP and Shell Commands

 
0
  #2
Aug 12th, 2008
I don't exactly know how to do this ... but if the FTP login data for your shell command, or your shell command is held in any type of plain-text based file you should be able to do this easily enough.

If so, post the file and I'll take a look...

If not, good luck
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 160
Reputation: w_3rabi is an unknown quantity at this point 
Solved Threads: 8
w_3rabi's Avatar
w_3rabi w_3rabi is offline Offline
Junior Poster

Re: PHP and Shell Commands

 
0
  #3
Aug 13th, 2008
try using
system ( string command [, int return_var])
programming is an art ,only for those who can understand it.
- th3 php wr3nch -
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 84
Reputation: MVied is an unknown quantity at this point 
Solved Threads: 5
MVied's Avatar
MVied MVied is offline Offline
Junior Poster in Training

Re: PHP and Shell Commands

 
0
  #4
Aug 13th, 2008
If that doesn't work, you can use shell_exec. Here's a fun tutorial that uses it.

http://www.sitepoint.com/article/take-command-ajax/2
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC