- 论坛徽章:
- 0
|
想用 ftp_connect() 和 ftp_login 来 authenticate users.
得到以下错误信息:
Warning: ftp_connect(): php_hostconnect: connect failed in getpw.php on line 12
Warning: ftp_quit() expects parameter 1 to be resource, boolean given in getpw.php on line 20
请问是怎么回事?
我用的是 php 4.3.2, phpinfo() 显示 ftp 是 enabled的.
我的 code 是这样的:
function login_session($uname, $passwd)
{
$host = "127.0.0.1";
$hostip = gethostbyname($host);
$conn_id = ftp_connect($hostip); -----line12 where the first warning refered
$result = true;
if (@ftp_login($conn_id, $uname, $passwd))
$result = true;
else
$result = false;
ftp_quit($conn_id); -----line20 where the second warning refered.
return $result; |
|