在PHP cURL中设置FTP模式

Out*_*ced 2 php ftp curl

我有一些代码使用PHP cURL库通过FTP上传一些文件.

我被告知要将FTP模式从被动切换到主动,但是我找不到怎么做 - 在与它相关的文档中似乎没有选项.我实际上不确定它目前使用的模式,或者我如何查看它.

Ras*_*iel 5

这个问题的答案是使用:

$curl = curl_init()
curl_setopt($curl, CURLOPT_FTP_USE_EPRT, true);
Run Code Online (Sandbox Code Playgroud)

这将允许您执行Active ftp上传.