[wp-trac] [WordPress Trac] #55307: After upgrading Debian, WordPress sites no longer update through FTP

WordPress Trac noreply at wordpress.org
Sat Mar 5 20:09:31 UTC 2022


#55307: After upgrading Debian, WordPress sites no longer update through FTP
-----------------------------+------------------------------
 Reporter:  zippy1970        |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Upgrade/Install  |     Version:  trunk
 Severity:  major            |  Resolution:
 Keywords:  needs-testing    |     Focuses:
-----------------------------+------------------------------

Comment (by zippy1970):

 Actually, I've done some testing and I now know exactly what is causing
 the problem.

 ftp_nlist() ''**always**'' returns false when the second parameter is a
 file instead of a directory on my system.

 {{{#!php
 <?php
 $ftp_server = "ftp.myserver.com";
 $ftp_user_name = "myusername";
 $ftp_user_pass = "mypassword";

 $ftp = ftp_connect($ftp_server);
 $login_result = ftp_login($ftp, $ftp_user_name, $ftp_user_pass);

 // check connection
 if ((!$ftp) || (!$login_result)) {
     echo "FTP connection has failed!\n";
     exit;
 } else {
     echo "Connected.\n";
 }
 ftp_pasv( $ftp, true );

 $list = ftp_nlist( $ftp, '/' );
 if( empty( $list ) ) {
   echo "File list is empty.\n";

 } else {
   foreach( $list as $file ) {
     echo "$file\n";
   }

   $list = ftp_nlist( $ftp, '/ftptest.php' );
   if( ! $list ) {
     echo "\nNot found.\n";
   } else {
     echo "\nFound!\n";
   }


 }

 // close the FTP connection
 ftp_close($ftp);
 >
 }}}

 On my server, the output is:


 {{{
 Connected.
 /.
 /..
 /htdocs
 /cgi-bin
 /logs
 /ftptest.php

 Not found.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55307#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list