gpt4 book ai didi

PHP - 无法找到套接字传输 "ssl"

转载 作者:太空宇宙 更新时间:2023-11-03 12:59:56 25 4
gpt4 key购买 nike

系统信息

  • Win 10 专业版 x64
  • PHP 7.3.10 x64 测试版
  • HTTPD 2.4.34

我已按照本指南生成必要的 key 和证书文件。

How do I allow HTTPS for Apache on localhost?

httpd.conf

LoadModule ssl_module modules/mod_ssl.so

extra/vhosts.conf

<IfModule ssl_module>
<VirtualHost _default_:443>
SSLEngine on
SSLCertificateFile "${CONF_PATH}/certs/localhost.cert"
SSLCertificateKeyFile "${CONF_PATH}/certs/localhost.key"

...
</VirtualHost>
</IfModule>

php.ini

extension=openssl

[curl]
curl.cainfo="C:\bin\httpd\conf\certs\localhost.cert"

[openssl]
openssl.cafile="C:\bin\httpd\conf\certs\localhost.cert"

这通常是人们会说复制 libeay32ssleay32 的地方,但是,为了向其他人记录这一点,这些文件不再包含在最近的构建中。它们现在是 libcryptolibssh。我将它们复制到 Apache bin 目录中。

使用 phpinfo() 进入页面确认这些设置,SSL 标记为启用。

让我们做一些 HTTPS 请求。

pecl update-channels
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is not responding over http://, failed with message: Connection to `ssl://pear.php.net:443' failed: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
Trying channel "pear.php.net" over https:// instead
Cannot retrieve channel.xml for channel "pear.php.net" (Connection to `ssl://pear.php.net:443' failed: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date

嗯,那可不好。我看到了一些关于从 PECL 脚本中删除 -n 标志的建议。所以我就那样做了。让我们看看现在是否有任何不同。

pecl update-channels
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is not responding over http://, failed with message: Connection to `ssl://pear.php.net:443' failed:
Trying channel "pear.php.net" over https:// instead
Cannot retrieve channel.xml for channel "pear.php.net" (Connection to `ssl://pear.php.net:443' failed: )
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date

不,这实际上更糟。现在关于它失败的原因的细节更少了。

对于我没有取得任何成功的原因,是否有人有我在这里遗漏的任何额外见解?

最佳答案

您的 HTTPD php.ini(您已通过“使用 phpinfo() 转到页面”进行检查)可能与您的 pecl(命令行)php.ini 文件不同。确保 pecl 使用启用了 openssl 的 php.ini。参见 pecl config-show,还有 https://stackoverflow.com/a/49623714/68939 .

关于PHP - 无法找到套接字传输 "ssl",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58386400/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com