";未能打开流:HTTP请求失败”;在PHP上使用ftp_put


"failed to open stream: HTTP request failed" using ftp_put on PHP

运行代码时出现此错误。

ftp_put(http://domain.com)[function.ftp put]:无法打开流:HTTP请求失败!HTTP/1.1 403禁止

这是我的代码:

ftp_put($conn_id, $remote_file, $file, FTP_ASCII)

它怎么了?

ftp_put不适用于HTTP流。您需要使用FTP_connect和FTP_login打开FTP连接。