Page 1 of 1

ftp_exec() not working

Posted: Mon May 22, 2006 10:20 am
by Bone
Can anyone tell me if there is an known bug with php's ftp_exec() function not working. Every time I execute the code on an FC3 server php 5. I get an error message saying ...
Warning: ftp_exec(): Unknown SITE command.

the code looks something like this...

<?php

$conn = ftp_connect($host, $port);
$command = "ls -l ";

if (ftp_exec($conn, $command)) {
echo "$command executed successfully\n";
} else {
echo "could not execute $command\n";
}


?>


:?:

Re: ftp_exec() not working

Posted: Mon May 22, 2006 11:10 am
by RobertGonzalez

Code: Select all

<?php
$conn = ftp_connect($host, $port);
$command = "ls -l"; // Removed the space at the end of -l

if (ftp_exec($conn, $command)) {
   echo "$command executed successfully\n";
} else {
   echo "could not execute $command\n";
}

?>
Not sure if it will do anything, but I removed the space at the end of ls -l.