954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP and Shell Commands

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.

Morty222
Light Poster
29 posts since Jan 2008
Reputation Points: 10
Solved Threads: 0
 

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

langsor
Posting Whiz
390 posts since Aug 2008
Reputation Points: 30
Solved Threads: 36
 

try using
system ( string command [, int return_var])

w_3rabi
Junior Poster
160 posts since Dec 2006
Reputation Points: 18
Solved Threads: 9
 

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

MVied
Junior Poster
112 posts since Aug 2008
Reputation Points: 21
Solved Threads: 11
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You