PHP FTP Get directory content is empty

Source: Internet
Author: User
Tags ftp protocol

Using PHP's FTP function to get the contents of the directory, Ftp_nlist () and Ftp_rawlist () return are empty.

Looked up a circle of information can not find the answer, and then wrote in Python, the same operation will be able to get the contents of the directory.

The capture packet found that Python automatically changed to passive mode before getting the contents of the directory, and Ftp_rawlist () manually ftp_pasv ($con, TRUE) before PHP was able to get the content.

Summary: Perhaps the FTP protocol does not understand, resulting in such problems, write down here, to prevent you from stepping on the pit ^_^

PHP FTP Get directory content is empty

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.