ftp_site () SITE command not implemented

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

ftp_site () SITE command not implemented

Post 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 :)
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

ftp_chmod() is only in PHP5, just so you know ;)
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post 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)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

you can still do mark's second suggestion.
Post Reply