|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51779 FTP socket failed
Submitted: 2010-05-10 04:57 UTC Modified: 2021-02-28 04:22 UTC
From: michael dot clark at ncver dot edu dot au Assigned: cmb (profile)
Status: No Feedback Package: FTP related
PHP Version: 5.2.13 OS: HP-UX 11.23 ia64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: michael dot clark at ncver dot edu dot au
New email:
PHP Version: OS:


 [2010-05-10 04:57 UTC] michael dot clark at ncver dot edu dot au
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:
$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

Actual result:
FTP pwd: /home

Warning: ftp_rawlist() [function.ftp-rawlist]: socket() failed: Protocol not supported (221) 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-10 06:31 UTC] 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-12 09:07 UTC]
Well, obviously socket(AF_INET, SOCK_STREAM, 0) fails for you, no idea why yet -- might be an HP-UX only issue.
 [2021-02-17 15:52 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-02-17 15:52 UTC]
Is this still an issue with any of the actively supported PHP

[1] <>
 [2021-02-28 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jun 04 04:05:52 2023 UTC