943,587 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1241
  • PHP RSS
Aug 12th, 2008
0

PHP and Shell Commands

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Light Poster
Morty222 is offline Offline
29 posts
since Jan 2008
Aug 12th, 2008
0

Re: PHP and Shell Commands

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
Reputation Points: 30
Solved Threads: 36
Posting Whiz
langsor is offline Offline
389 posts
since Aug 2008
Aug 13th, 2008
0

Re: PHP and Shell Commands

try using
system ( string command [, int return_var])
Reputation Points: 18
Solved Threads: 9
Junior Poster
w_3rabi is offline Offline
160 posts
since Dec 2006
Aug 13th, 2008
0

Re: PHP and Shell Commands

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
Reputation Points: 21
Solved Threads: 11
Junior Poster
MVied is offline Offline
111 posts
since Aug 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC