- 论坛徽章:
- 0
|
我有3台机子,A B C。
A 是本机 win7系统 是wamp的 php的集成包。
B 是本机的VM虚拟机 ubuntu12.10 64 server版 iptables -F 了 卸载了自带的FTP 装了vsftpd
C 是本机的VM虚拟机 ubuntu12.10 64 server版 iptables 开放了 20 80 22 端口 安装了vsftpd
同时执行一个链接FTP的脚本如下:-
- $hostip="www.pooy.net";
- $hostuser="root";
- $hostpass="root";
- $hostpath="/";
- $conn_id = ftp_connect($hostip);
- $login_result = ftp_login($conn_id,$hostuser,$hostpass);
- //var_dump($login_result);
- if ((!$conn_id) || (!$login_result))
- {
- echo "FTP connection has failed!";
- }
- else
- {
- echo "Connected to $hostip, for user $hostuser";
- }
- ftp_close($conn_id);
复制代码 结果如下:
A在浏览器执行: Connected to www.pooy.net, for user root
B&C在浏览器执行: FTP connection has failed!
B&C在linux执行并报错:
PHP Warning: ftp_login() expects parameter 1 to be resource, boolean given in /var/www/test.php on line 14
FTP connection has failed!PHP Warning: ftp_close() expects parameter 1 to be resource, boolean given in /var/www/test.php on line 25
请问如何处理? |
|