tcostello Posted March 6, 2006 Share Posted March 6, 2006 I am using php_ftp to get the last modified-date of a file on a foriegn server. I can create the ftp connection, but I cannot close the connection. Do I have to do something to the PHP configuration file? I am running PHP 4.1.2 on Apache 1.3.26 The error I get is:Fatal error: Call to undefined function: ftp_close() in foo/bar/foo.php on line 66My code is below:<?function get_date($filename){ $ftp_server = server; $ftp_user_name = user; $ftp_user_pass = pass; $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection if ((!$conn_id) || (!$login_result)) { echo "ERROR!<BR>"; exit; } ftp_close($conn_id); //if this function is left in the script I get the "fatal error." return ftp_mdtm($conn_id, $filename);} ?> Quote Link to comment https://forums.phpfreaks.com/topic/4270-ftp_close-undefined/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.