note 57890 added to ref.exec
| From: | kenlichen at gmail dot com | Date: | Tue, 18 Oct 2005 11:19:24 +0000 |
| Subject: | note 57890 added to ref.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97157@lists.php.net to get a copy of this message | ||
I wrote a ftp script to transfer files from web page.
The server is Redhat El 3.0.
I use exec() function to execute this script.
It doesn't work well.
exec("./ftp.sh $host $username $passwd $file_path $file);
//----- exec() dose not work well!!
But if I use system(), it works.
system("./ftp.sh $host $username $passwd $file_path $file);
//----system() works.
ftp.sh scripte:
#!/bin/bash
echo 'open '$1'
user '$2' '$3'
bi
ha
lcd '$4'
put '$5'
close
quit' > ftp.param
ftp -invd < ftp.param
I hope this is useful for anyone trying to automatic ftp files from web page.
----
Manual Page -- http://www.php.net/manual/en/ref.exec.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57890
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57890&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57890&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57890&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57890&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57890&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57890&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57890&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57890&report=yes
Search -- http://master.php.net/manage/user-notes.php