Php 无法使用fsockopen连接到服务器

Php 无法使用fsockopen连接到服务器,php,ftp,nginx,fsockopen,ftps,Php,Ftp,Nginx,Fsockopen,Ftps,nginx错误日志中的错误: fsockopen():SSL操作失败,代码为1。OpenSSL错误消息:错误:140770FC:SSL例程:SSL23\U GET\U SERVER\U HELLO:在线未知协议 我可以使用FileZilla、WinSCP和ftp\u ssl\u connect()进行连接。但我无法使用fsockopen(“ssl://domain.com“,$port,$errno,$errstr,$timeout) 此命令openssl s_client-connect do

nginx错误日志中的错误:
fsockopen():SSL操作失败,代码为1。OpenSSL错误消息:错误:140770FC:SSL例程:SSL23\U GET\U SERVER\U HELLO:在线未知协议

我可以使用FileZilla、WinSCP和ftp\u ssl\u connect()进行连接。但我无法使用
fsockopen(“ssl://domain.com“,$port,$errno,$errstr,$timeout)

此命令
openssl s_client-connect domain.com:21-starttls ftp
为我提供了正确的输出,但如果我删除starttls命令,则会出现以下错误:

CONNECTED(00000003)
47404513277584:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:766:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 7 bytes and written 321 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---

谁能帮我把STARTTLS命令放到我的PHP代码中?请告诉我,如果你们需要任何其他详细信息,我将编辑帖子。

尝试使用465端口。为了获得更好的答案,请提供一些信息(一些php代码,或者如果您使用的是像PhpMailer这样的专用php类,请指定它)