Bug #51779 [Opn->Fbk]: FTP socket failed
| From: | cmb@php.net | Date: | Wed, 17 Feb 2021 15:52:11 +0000 |
| Subject: | Bug #51779 [Opn->Fbk]: FTP socket failed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232225@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51779&edit=1
ID: 51779
Updated by: cmb@php.net
Reported by: michael dot clark at ncver dot edu dot au
Summary: FTP socket failed
-Status: Open
+Status: Feedback
Type: Bug
Package: FTP related
Operating System: HP-UX 11.23 ia64
PHP Version: 5.2.13
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Is this still an issue with any of the actively supported PHP
versions[1]?
[1] <php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2010-05-12 09:07:36] mike@php.net
Well, obviously socket(AF_INET, SOCK_STREAM, 0) fails for you, no idea why yet -- might be an HP-UX
only issue.
------------------------------------------------------------------------
[2010-05-10 06:31:15] michael dot clark at ncver dot edu dot au
Sorry, forgot to mention.
ftp_pasv is no help in this case, especially when client and server are the same machine.
PS thanks for any help resolving this issue.
------------------------------------------------------------------------
[2010-05-10 04:57:18] michael dot clark at ncver dot edu dot au
Description:
------------
Have built new installations of apache 2.2.14 with PHP 5.2.13 to replace previous installation of
Apache 2.0 with PHP 4.3.4.
Other functionality has all worked.
We are recieving warning on all file related ftp functions:
Warning: ftp_rawlist() [function.ftp-rawlist]: socket() failed: Protocol not supported (221)
Connection to server and login complete successfully.
When trying to list, put, get any data it fails.
My guess is connection successful on first port but second (data) port not successful?
Test script:
---------------
<?php
$conn_id = ftp_connect("server");
$login_result = ftp_login($conn_id, "user", "pass");
// check connection
if ((!$conn_id) || (!$login_result)) {
$error_message .= "FTP connection has failed!";
} else {
echo "FTP pwd: ".ftp_pwd($conn_id). "<br />";
$remote_list = ftp_rawlist($conn_id, "/home/devdba");
foreach ($remote_list as $list_item) {
echo $list_item."<br />";
}
}
?>
Expected result:
----------------
FTP pwd: /home
item1
item2
item3
Actual result:
--------------
FTP pwd: /home
Warning: ftp_rawlist() [function.ftp-rawlist]: socket() failed: Protocol not supported (221)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=51779&edit=1