Good day. There is a PHP code that receives a list of files from an FTP server. The code works through a proxy that supports FTP over HTTP mode. Here is the code itself
$proxy_host = "1.1.1.1"; $proxy_port = 8080; $curl = curl_init(); $ftp_url = 'ftp://login:password@ftp:21/dir'; curl_setopt($curl,CURLOPT_TIMEOUT,10); curl_setopt($curl,CURLOPT_RETURNTRANSFER,1); curl_setopt($curl,CURLOPT_FTPLISTONLY,1); curl_setopt($curl,CURLOPT_PROXYTYPE,CURLPROXY_HTTP); curl_setopt($curl,CURLOPT_PROXY,$proxy_host); curl_setopt($curl,CURLOPT_PROXYPORT,$proxy_port); curl_setopt($curl,CURLOPT_PROXYUSERPWD,'login_proxy:password_proxy'); curl_setopt($curl,CURLOPT_URL,$ftp_url); curl_setopt($curl,CURLOPT_VERBOSE,FALSE); curl_setopt($curl,CURLOPT_HEADER,0); $content=curl_exec($curl); echo $content; The code works fine, but displaying the file list always prefixes the message.curl 230 OK. Current restricted directory is / curl 230 OK. Current restricted directory is / . This message is present even when I try to download files. That is, the contents of all downloaded files contain this diagnostic message. How to disable the output of this message?
Addition
The CURLOPT_VERBOSE parameter (true, false, absent) does not affect the message in any way. There is a suspicion that it is enabled by default and does not turn off.
More additions
I tried on versions PHP 5.3.13 and 5.6.30 version curl (from phpinfo) 7.24.0 It is important that without a proxy server everything works fine.
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($curl, CURLOPT_FTP_SSL, CURLFTPSSL_ALL); curl_setopt($curl, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS); curl_setopt($curl, CURLOPT_SSLVERSION, 3); curl_setopt($curl, CURLOPT_FTPPORT,'-');curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($curl, CURLOPT_FTP_SSL, CURLFTPSSL_ALL); curl_setopt($curl, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS); curl_setopt($curl, CURLOPT_SSLVERSION, 3); curl_setopt($curl, CURLOPT_FTPPORT,'-');- Vanya Avchyan