Page 1 of 1

ftp_site () SITE command not implemented

Posted: Fri Apr 02, 2004 5:31 pm
by Chris Corbyn
Hi,

I'm trying to chmod a file onthe ftp site I store my files on.

I'm using this bit of code [it's not ftp_chmod ();) because that function kept returning "Call to undefined function: ftp_chmod ()" for some reason but if anyone know an answer for that problem there's no need to solve this one here].

Code: Select all

<?php

$ftp_ip="ftp.dur.ac.uk"; 
$ftp_login="my user name"; 
$ftp_pass="my password"; 
$ftp_file="public_html/test.txt"; 

$conn_id=ftp_connect($ftp_ip); 
$login_result=@ftp_login($conn_id, $ftp_login, $ftp_pass); 

$chmod_cmd="CHMOD 0644 ".$ftp_file; 
$chmod=ftp_site($conn_id, $chmod_cmd); 


ftp_quit($conn_id);

?>
The only problem is that when I load the script in my browser I get this message:
Warning: ftp_site(): SITE command not implemented. in /home/hudson/ug/d11wtq/public_html/chmod.php on line 12
Any idea how to get this to work? (or just how to get ftp_chmod to work even?)

Thanks guys :)

Posted: Fri Apr 02, 2004 5:43 pm
by markl999
ftp_chmod() is only in PHP5, just so you know ;)

Posted: Fri Apr 02, 2004 5:47 pm
by markl999
Try connecting to the ftp server (not in PHP ;)) and typing 'site help' it will show you what commands it supports, make sure CHMOD is there.

(oops, meant to say these in one post, not two)

Posted: Fri Apr 02, 2004 5:57 pm
by Chris Corbyn
Aaah,

Ok I see what the problem is now then. My server is only running PHP 4. I guess maybe they'll move to 5 soon but it's still kinda new isn't it.

Thanks guys

Posted: Fri Apr 02, 2004 6:13 pm
by Illusionist
you can still do mark's second suggestion.