Page 1 of 2
ftp_exec
Posted: Thu Apr 24, 2003 4:21 am
by axeluck
Hi,
I have to perform a perl or a shell program from an internet page by ftp.
When i use this function a message appear : " ftp_exec(): SITE command not implemented".
$FTP_COMMAN= "/export/home/.../create_work_dir.sh";
ftp_exec($ftp,$FTP_COMMAN);
Can someone help me?
Thanks in advance!
Posted: Thu Apr 24, 2003 4:33 am
by d1223m
do you need to install a module or somthing?
look at the php main page for the ftp commands. there it will list any dependancies
Posted: Thu Apr 24, 2003 5:06 am
by axeluck
I don't see any module to install...
Posted: Thu Apr 24, 2003 5:21 am
by d1223m
In order to use FTP functions with your PHP configuration, you should add the --enable-ftp option when installing PHP 4 or --with-ftp when using PHP 3.
The windows version of PHP has built in support for this extension. You do not need to load any additional extension in order to use these functions.
so you have done this?
after looking some pages and stuff im also wondering if your ftpd actually supports this command. can u test it somehow without php or check the ftpd's docs?
Posted: Thu Apr 24, 2003 5:30 am
by axeluck
Yes, i have a windows version of PHP with easyphp.
What is ftpd?
How can i check it without php?
Posted: Thu Apr 24, 2003 5:35 am
by d1223m
your "ftpd" is your ftp deamon
you could check it with any ftp client that has the command.
if your graphical client cant do it then there is always command line ( Start->Run: ftp.exe ) *grin*
failing that.. well.. there's always telnet
Posted: Thu Apr 24, 2003 7:13 am
by axeluck
May be an other method...
i just want perform a program unix from the web...
If any ideas i'm aware.
Posted: Thu Apr 24, 2003 7:16 am
by []InTeR[]
If i have to execute a unix commando in a php script i do it like this.
Code: Select all
$exec = "cd ".$dir."\n".stripslashes($command);
echo "<pre>";
$str = passthru($exec." 2>&1");
echo "</pre>";
Posted: Thu Apr 24, 2003 7:21 am
by volka
SITE EXEC is disabled on most ftp servers, simply because it's dangerous and useful like a hole in the head

Is ftp the only access you have to that box?
Posted: Thu Apr 24, 2003 7:28 am
by axeluck
yes just ftp access...
Posted: Thu Apr 24, 2003 7:29 am
by []InTeR[]
Hmm, then my code is useless.
Sorry for the mistake.
Posted: Thu Apr 24, 2003 7:43 am
by axeluck
if not ftp i don't see how to connect to the unix server...
Posted: Thu Apr 24, 2003 7:57 am
by d1223m
does the server have a webserver?
Posted: Thu Apr 24, 2003 7:59 am
by axeluck
it don't have webserver...
Posted: Thu Apr 24, 2003 8:06 am
by d1223m
well you need _some_ sort of connect other than ftp.
maybe look into some sort of remote procedure language. ive just been looking at php news and i saw this link:
http://www.phpdeveloper.org/index.php?id=1391