在 window7 上安装 Typo3 6.2.2 时 PHP OpenSSL 扩展不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23754996/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP OpenSSL extension not working while install Typo3 6.2.2 on window7
提问by user3471037
I've installed Typo3 6.2.2 on window7 but I got an error message as below:
我已经在 window7 上安装了 Typo3 6.2.2,但收到如下错误消息:
PHP OpenSSL extension not working
Something went wrong while trying to create a new private key for testing. Please check the integration of the PHP OpenSSL extension and if it is installed correctly.
PHP OpenSSL extension not working
Something went wrong while trying to create a new private key for testing. Please check the integration of the PHP OpenSSL extension and if it is installed correctly.
I try to find the solution on the internet about this error but I can not solve this bug.
我尝试在互联网上找到有关此错误的解决方案,但无法解决此错误。
Anyone know, can you help me to find the solution please? Thanks.
有谁知道,能帮我找到解决办法吗?谢谢。
回答by Alan
Solution that worked for me on XAMPP and Windows Vista:
在 XAMPP 和 Windows Vista 上对我有用的解决方案:
Activate the PHP module openssl
Open php.ini and uncomment(delete ';') in:
;extension=php_openssl.dll
Double-check that the extension is enabled by running phpinfo().
Add a system environment variable "OPENSSL_CONF"with value
C:\xampp\apache\conf\openssl.cnf
...assuming you installed xampp into C:\xampp.
Set path to 'openssl.exe', which is in C:\xampp\apache\bin
Either set
$TYPO3_CONF_VARS['SYS']['binSetup']
in...\htdocs\typo3_src-6.2.x\typo3\sysext\core\Configuration\DefaultConfiguration.php
to'openssl=c:/xampp/apache/bin/openssl.exe'
or append
c:\xampp\apache\bin
to the environment variable PATH (will work for every PHP script not only TYPO3)
Restart xampp
激活 PHP 模块 openssl
打开 php.ini 并取消注释(删除 ';'):
;extension=php_openssl.dll
通过运行 phpinfo() 仔细检查扩展是否已启用。
添加具有值的系统环境变量“OPENSSL_CONF”
C:\xampp\apache\conf\openssl.cnf
...假设您将 xampp 安装到 C:\xampp。
将路径设置为 'openssl.exe',位于 C:\xampp\apache\bin
无论是设置
$TYPO3_CONF_VARS['SYS']['binSetup']
在...\htdocs\typo3_src-6.2.x\typo3\sysext\core\Configuration\DefaultConfiguration.php
以'openssl=c:/xampp/apache/bin/openssl.exe'
或附加
c:\xampp\apache\bin
到环境变量 PATH (不仅适用于 TYPO3 的每个 PHP 脚本)
重启xampp
Links/sources:
链接/来源:
回答by Jpsy
To enable OpenSSL on PHP under Windows, three steps must be taken:
Windows下在PHP上启用OpenSSL,需要三个步骤:
enable the extension – make sure to uncomment this line in php.ini:
extension=php_openssl.dll
Add the PHP folder to the PATH environment variable of Windows:
Control Panel –> System –> Advanced System Settings –> Environment Variables.
Locate the Path variable in the System Variables block.
Prependc:\php;
in front of it, or whatever your PHP path is.Create an additional OPENSSL_CONF environment variable for Windows which contains the full path of the OpenSSL config file of PHP:
Control Panel –> System –> Advanced System Settings –> Environment Variables.
In the System Variables block click New...
Variable name:OPENSSL_CONF
Variable value:C:\php\extras\ssl\openssl.cnf
Modify that value to match your PHP installation directory!
启用扩展——确保在 php.ini 中取消注释这一行:
extension=php_openssl.dll
将PHP文件夹添加到Windows的PATH环境变量中:
控制面板->系统->高级系统设置->环境变量。
在 System Variables 块中找到 Path 变量。
前置c:\php;
在它前面,或任何你的PHP路径。为 Windows 创建一个额外的 OPENSSL_CONF 环境变量,其中包含 PHP 的 OpenSSL 配置文件的完整路径:
控制面板->系统->高级系统设置->环境变量。
在 System Variables 块中单击 New...
Variable name:OPENSSL_CONF
Variable value:C:\php\extras\ssl\openssl.cnf
修改该值以匹配您的 PHP 安装目录!
Restart Windows so the environment changes can take effect.
重新启动 Windows 以使环境更改生效。
Details on PHP OpenSSL support under Windows can be found here.
可以在此处找到有关 Windows 下 PHP OpenSSL 支持的详细信息。
回答by user3733912
On typo3 6.2.7on win7 XAMPP 1.8.3
在typ3 6.2.7on win7 XAMPP 1.8.3
The openSSL error's solution was to create C:\openssl-1.0.1i-win32\sslfolder and put E:\Portables\xampp\apache\conf\openssl.cnfinto it. I got a direction about it from a german website.
openSSL 错误的解决方法是创建C:\openssl-1.0.1i-win32\ssl文件夹并将E:\Portables\xampp\apache\conf\openssl.cnf放入其中。我从一个德国网站上得到了有关它的指导。
How I found it out (just in case versions change), in the shell on XAMPP control panel, openssl command gives
我是如何发现的(以防版本更改),在 XAMPP 控制面板上的 shell 中,openssl 命令给出
WARNING: can't open config file: E:/Portables/xampp/apache/bin/openssl.cnf.
警告:无法打开配置文件:E:/Portables/xampp/apache/bin/openssl.cnf。
But adding the file there does not help. I added and removed the file.
但是在那里添加文件没有帮助。我添加并删除了该文件。
Add ;E:\Portables\xampp\apache\bin
to PATH environment variable (System properties -> Advanced). Run command openssl on a CMD window(not XMPP shell), the message:
添加;E:\Portables\xampp\apache\bin
到 PATH 环境变量(系统属性 -> 高级)。在 CMD 窗口(不是 XMPP shell)上运行命令 openssl,消息:
WARNING: can't open config file: c:/openssl-1.0.1i-win32/ssl/openssl.cnf
警告:无法打开配置文件:c:/openssl-1.0.1i-win32/ssl/openssl.cnf
Add the file there, the addition to environment variable PATH can be removed now.
在那里添加文件,现在可以删除添加到环境变量 PATH 的内容。
Adding OPENSSL_CONF
also did not work for me.
添加OPENSSL_CONF
也对我不起作用。
回答by John Clark
Set a global environment variable OPENSSL_CONF to %ProgramFiles(x86)%\PHP\Current\extras\openssl.cnf
将全局环境变量 OPENSSL_CONF 设置为 %ProgramFiles(x86)%\PHP\Current\extras\openssl.cnf
回答by David
The following solution might only work by manual start of the Apache-Server by click on apache_start.bat
inside Xampp, other use-cases and server-packages are not tested or covered.
以下解决方案可能只能通过apache_start.bat
在 Xampp 内部单击手动启动 Apache 服务器才能工作,其他用例和服务器包未经过测试或涵盖。
Dealing with several versions of xampp and perhaps additional several frameworksI searched for an approach that is best fitting to the following requirements:
处理多个版本的 xampp 以及可能的其他几个框架,我搜索了最适合以下要求的方法:
- A framework never has to know about the configuration or the path to the executable openssl-file (in windows:
openssl.exe
). - It doesn't matter which server is started, the right path to openssl is always found, fitting to the version of the server. This avoids problems that openssl might be compiled with another version than PHP or Apache-Server.
- Variables never have to be added unflexible and static to the PATH-Variable. Instead they shall only be added as long as a server is running.
- Stopping one server-version and starting another server-version is switching without further actions to the right path of
openssl.exe
andopenssl.cnf
.
- 框架永远不必知道可执行文件 openssl 文件的配置或路径(在 Windows 中:)
openssl.exe
。 - 启动哪个服务器并不重要,总是会找到适合服务器版本的 openssl 的正确路径。这避免了 openssl 可能使用 PHP 或 Apache-Server 以外的其他版本编译的问题。
- 永远不必将不灵活和静态的变量添加到 PATH 变量中。相反,它们只能在服务器运行时添加。
- 停止一个服务器版本,并启动另一台服务器版本,而不采取进一步行动,以正道是开关
openssl.exe
和openssl.cnf
。
Based on these developer-requirements the steps I describe are a bit different than the running answers on this page:
根据这些开发人员要求,我描述的步骤与此页面上的运行答案略有不同:
Enable openssl in the
php.ini
-file of each server-version (i.e. xampp-1, xampp-2, etc.) by removing the leading semicolon of the following line:;extension=php_openssl.dll
Open the file
apache_start.bat
of each server-version and replace the lineapache\bin\httpd.exe
by the following snippet:
SET OPENSSL_CONF=C:\xampp-x\apache\conf\openssl.cnf IF EXIST C:\xampp-x\apache\bin SET PATH=%PATH%;C:\xampp-x\apache\bin apache\bin\httpd.exe
Pay attention that you everywhere replace
C:\xampp-x\
by the real path to the corresponding server.Restart xampp either by apache_start.bat or by the xampp-control-panel.
php.ini
通过删除以下行的前导分号,在每个服务器版本(即 xampp-1、xampp-2 等)的-file 中启用 openssl :;extension=php_openssl.dll
打开
apache_start.bat
每个服务器版本的文件并替换该行apache\bin\httpd.exe
通过以下片段:
SET OPENSSL_CONF=C:\xampp-x\apache\conf\openssl.cnf IF EXIST C:\xampp-x\apache\bin SET PATH=%PATH%;C:\xampp-x\apache\bin apache\bin\httpd.exe
注意你到处替换
C:\xampp-x\
为对应服务器的真实路径。通过 apache_start.bat 或 xampp-control-panel 重新启动 xampp。
This solution naturally works also with only one server and with the advantage having limited PATH-Variables system-wide defined.
该解决方案自然也仅适用于一台服务器,并且具有系统范围定义的有限路径变量的优势。
UPDATEIf you have still problems related to TYPO3, no matter about the method you chosed, check the cookie_domain in the installtool. It should apply to the current domain or being empty. A wrong cookie-domaincan happen if you copy a project from another server, i.e. for development.
更新如果您仍然有与 TYPO3 相关的问题,无论您选择哪种方法,请检查安装工具中的 cookie_domain。它应该适用于当前域或为空。一个错误的cookie的域名,如果你从另一台服务器复制一个项目,即发展可能发生。