套接字传输“ssl”在 PHP 中未启用

发布于 2024-08-10 14:10:27 字数 751 浏览 4 评论 0原文

我在 PHP 中启用套接字传输“ssl”时遇到问题。当我运行脚本时,出现错误:

警告:fsockopen() [function.fsockopen]:无法 连接到 ssl://www.my.site.com:443 (无法找到套接字传输 “ssl” - 您是否忘记启用它 你什么时候配置PHP的?)

我在 Windows 上运行 IIS6,这就是我到目前为止所做的尝试让它工作:

  • 取消注释 php.ini 中的 php_openssl.dll 和 php_sockets.dll 扩展
  • ,确保 PHP 正在加载我对 ini 文件进行了更改(确实如此,而且它肯定正在加载其他扩展,所以我相当确定这不是问题)
  • 确保 php_openssl.dll 和 php_sockets.dll 位于正确的位置,
  • 复制了 ssleay32.dll 和 libeay32 .dll 到主 PHP 文件夹、WINDOWS 文件夹和 WINDOWS/system32 文件夹,
  • 确保 Windows 路径变量包含 PHP 的位置,
  • 确保所有相关文件的文件权限正确。

几乎每次更改后我都会重新启动 IIS,但我没有任何运气。有什么明显的事情表明我做错了吗?有没有办法在较小的部件上解决这个问题? (这样我就可以通过排除法找出问题...?)

不幸的是 Windows/IIS 不是我的专业领域——我被安排负责,因为其他人似乎什么都不知道。

I'm having trouble enabling the socket transport "ssl" in PHP. When I run my script, I get the error:

Warning: fsockopen()
[function.fsockopen]: unable to
connect to ssl://www.my.site.com:443
(Unable to find the socket transport
"ssl" - did you forget to enable it
when you configured PHP?)

I'm running IIS6 on Windows and this is what I've done so far to try to get it working:

  • uncommented the php_openssl.dll and php_sockets.dll extensions in php.ini
  • made sure PHP was loading the ini file I made changes to (it is, and it's definitely loading other extensions, so I'm fairly sure this isn't the problem)
  • made sure php_openssl.dll and php_sockets.dll were in the correct location
  • copied ssleay32.dll and libeay32.dll to the main PHP folder, the WINDOWS folder and the WINDOWS/system32 folder
  • made sure the Windows path variable included the location of PHP
  • made sure the file permissions were correct on all the relevant files.

I've restarted IIS after pretty much every change, but I haven't had any luck. Is there anything obvious that I'm doing wrong? Is there anyway to troubleshoot this in smaller parts? (So I can figure out the problem by the process of elimination...?)

Unfortunately Windows/IIS aren't my area of expertise--I've been put in charge because nobody else seems to know anything.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

大海や 2024-08-17 14:10:27

我在 Windows 7 中使用 Xampp 1.8.1 服务器在命令行中使用 PHP 5.4.0 时遇到问题。这就是我所做的:

  1. php.ini-product 重命名为 php.ini (在 C:\xampp\php\ 文件夹中)
  2. 编辑 php.ini 并取消注释 extension_dir=ext
  3. 同时取消注释 extension=php_openssl.dll

之后一切顺利。

I was having problem in Windows 7 with PHP 5.4.0 in command line, using Xampp 1.8.1 server. This is what i did:

  1. Rename php.ini-production to php.ini (in C:\xampp\php\ folder)
  2. Edit php.ini and uncomment extension_dir=ext.
  3. Also uncomment extension=php_openssl.dll.

After that it worked fine.

空‖城人不在 2024-08-17 14:10:27

成功!

检查日志文件并确保 php_openssl.dll 的权限正确后,我用 google 搜索了该警告,发现了更多可以尝试的事情。

所以我:

  • 将 C:\PHP\ext 添加到 Windows 路径
  • 将 libeay32.dll 和 ssleay32.dll 添加到 C:\WINDOWS\system32\inetsrv
  • 重新启动服务器

我不确定其中哪一个解决了我的问题,但它肯定已解决现在! :)

我在这个页面上找到了可以尝试的东西:
http://php.net/manual/en/install.windows.extensions.php感谢

您的帮助!

Success!

After checking the log files and making sure the permissions on php_openssl.dll were correct, I googled the warning and found more things to try.

So I:

  • added C:\PHP\ext to the Windows path
  • added libeay32.dll and ssleay32.dll to C:\WINDOWS\system32\inetsrv
  • rebooted the server

I'm not sure which of these fixed my problem, but it's definately fixed now! :)

I found these things to try on this page:
http://php.net/manual/en/install.windows.extensions.php

Thanks for your help!

难得心□动 2024-08-17 14:10:27

在 XAMPP 版本 1.7.4 服务器中,php ini 文件中没有 extension=php_openssl.dll 行。我们必须在 php.ini 文件中添加 extension=php_openssl.dll

In XAMPP Version 1.7.4 server does not have extension=php_openssl.dll line in php ini file. We have to add extension=php_openssl.dll in php.ini file

岁吢 2024-08-17 14:10:27

在 Laravel 4 上尝试使用 SSL 加密发送电子邮件时遇到了同样的问题。

在 Windows 7 64 位上使用 WAMPServer 2.2,我只在 php.ini 中启用了 php_openssl,重新启动 WAMPServer 并完美运行。

执行以下操作:

  • 单击 WampServer -> PHP-> PHP 扩展 -> php_openssl
  • 重新启动 WampServer

Ran into the same problem on Laravel 4 trying to send e-mail using SSL encryption.

Having WAMPServer 2.2 on Windows 7 64bit I only enabled php_openssl in the php.ini, restarted WAMPServer and worked flawlessly.

Did following:

  • Click WampServer -> PHP -> PHP extensions -> php_openssl
  • Restart WampServer
萌吟 2024-08-17 14:10:27

只需取消注释 extension=php_openssl.dll
重新启动 Apache 服务,这应该会有所帮助。

Just uncomment extension=php_openssl.dll
Restart Apache Service and that should help.

北陌 2024-08-17 14:10:27

我刚才在弄乱 laravel 时也遇到了这个问题。

我在 Windows 上使用 wampserver,必须将 /bin/apache/apacheversion/bin/php.ini 文件复制到 /bin/php/phpversion/php.ini

I also ran into this issue just now while messing with laravel.

I am using wampserver for windows and had to copy the /bin/apache/apacheversion/bin/php.ini file to /bin/php/phpversion/php.ini

情绪操控生活 2024-08-17 14:10:27

我正在使用 XAMPP 并遇到了同样的错误。我已经完成了所有这些步骤,添加了环境变量路径,将 dll 的每个可能的目录复制到 /php、/apache/bin、/system32、/syswow64 等。但仍然出现此错误。

然后在检查 apache 错误日志后,我注意到在路径中使用括号的问题。

PHP:语法错误,C:\Program Files 中出现意外的“(”
(其他)\xampp\php\php.ini 第 707 行 0 服务器证书不存在
包含与服务器名称匹配的 ID

如果您已将服务器安装在“Program Files (x86)”目录中,则由于非转义括号,可能会出现相同的错误。

要解决此问题,请打开 php.ini 文件并找到包含“include_path”的行,并用双引号将该路径括起来以修复此错误。

include_path="C:\Program Files (other)\xampp\php\PEAR"

I am using XAMPP and came across the same error. I had done all those steps, added environmental variables path, copied the dll's every directory possible, to /php, /apache/bin, /system32, /syswow64, etc.. but still got this error.

Then after checking the apache error log, I noticed the issue with using brackets in path.

PHP: syntax error, unexpected '(' in C:\Program Files
(other)\xampp\php\php.ini on line 707 0 server certificate does NOT
include an ID which matches the server name

If you have installed the server in "Program Files (x86)" directory, the same error might occur due to the non-escaped brackets.

To fix this, open php.ini file and locate the line containing "include_path" and enclose the path with double quotes to fix this error.

include_path="C:\Program Files (other)\xampp\php\PEAR"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文