Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Magento 2(cmd)-致命错误:未捕获错误:类';Cli';找不到_Php_Magento 2.0.7 - Fatal编程技术网

Php Magento 2(cmd)-致命错误:未捕获错误:类';Cli';找不到

Php Magento 2(cmd)-致命错误:未捕获错误:类';Cli';找不到,php,magento-2.0.7,Php,Magento 2.0.7,我刚刚在Windows7(64位)和WAMP(PHPVer.7.0.4)中安装了Magento2 之后,我将尝试使用以下命令清理和刷新缓存 php bin/magento cache:clean php bin/magento cache:flush 所以一开始它给了我php版本错误,所以我刚刚安装了最新的php php -v PHP 7.0.9 (cli) (built: Jul 20 2016 10:47:41) ( NTS ) Copyright (c) 1997-2016 The P

我刚刚在Windows7(64位)和WAMP(PHPVer.7.0.4)中安装了Magento2

之后,我将尝试使用以下命令清理和刷新缓存

php bin/magento cache:clean
php bin/magento cache:flush 
所以一开始它给了我php版本错误,所以我刚刚安装了最新的php

php -v
PHP 7.0.9 (cli) (built: Jul 20 2016 10:47:41) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
现在,在执行
php-bin/magento-cache:clean

D:\wamp64\www\m2>php bin/magento cache:clean
The openssl extension is required for SSL/TLS protection but is not available. I
f you can not enable the openssl extension, you can disable this error, at your
own risk, by setting the 'disable-tls' option to true
.... File list
.... File list
.... File list


Fatal error: Uncaught Error: Class 'Cli' not found in D:\wamp64\www\m2\bin\magen
to:31
Stack trace:
#0 {main}
  thrown in D:\wamp64\www\m2\bin\magento on line 31
执行
php bin/magento缓存时出现以下错误:flush

The openssl extension is required for SSL/TLS protection but is not available. I
f you can not enable the openssl extension, you can disable this error, at your
own risk, by setting the 'disable-tls' option to true.#0 D:\wamp64\www\m2\vendor
\composer\composer\src\Composer\Factory.php(306): Composer\Factory::createRemote
Filesystem(Object(Composer\IO\BufferIO), Object(Composer\Config))
#1 D:\wamp64\www\m2\vendor\composer\composer\src\Composer\Factory.php(532): Comp
oser\Factory->createComposer(Object(Composer\IO\BufferIO), Array, false)
#2 D:\wamp64\www\m2\vendor\magento\framework\Composer\ComposerFactory.php(48): C
omposer\Factory::create(Object(Composer\IO\BufferIO), 'D:\\wamp64\\www\\m...')
#3 D:\wamp64\www\m2\vendor\magento\framework\Composer\ComposerInformation.php(36
2): Magento\Framework\Composer\ComposerFactory->create()
#4 D:\wamp64\www\m2\vendor\magento\framework\Composer\ComposerInformation.php(37
5): Magento\Framework\Composer\ComposerInformation->getComposer()
#5 D:\wamp64\www\m2\vendor\magento\framework\Composer\ComposerInformation.php(24
2): Magento\Framework\Composer\ComposerInformation->getLocker()
#6 D:\wamp64\www\m2\vendor\magento\framework\App\ProductMetadata.php(104): Magen
to\Framework\Composer\ComposerInformation->getSystemPackages()
#7 D:\wamp64\www\m2\vendor\magento\framework\App\ProductMetadata.php(65): Magent
o\Framework\App\ProductMetadata->getSystemPackageVersion()
#8 D:\wamp64\www\m2\vendor\magento\framework\Console\Cli.php(81): Magento\Framew
ork\App\ProductMetadata->getVersion()
#9 D:\wamp64\www\m2\bin\magento(22): Magento\Framework\Console\Cli->__construct(
'Magento CLI')
#10 {main}


Fatal error: Uncaught Error: Class 'Cli' not found in D:\wamp64\www\m2\bin\magen
to:31
Stack trace:
#0 {main}
  thrown in D:\wamp64\www\m2\bin\magento on line 31
有人能帮我解决这个错误吗

我认为这主要与PHP错误有关,但我无法理解


如果您需要更多信息,请告诉我…

使用以下命令检查您的系统中是否安装了OpenSSL:

dpkg -l | grep -i openssl
如果这个命令没有得到任何结果,那意味着您需要安装OpenSSL

另一种选择是,您可以取消对php.ini配置文件中的代码extension=php_openssl.dll的注释


我希望这对您有所帮助。

我在本地主机的Magento2.1.2中也遇到了同样的问题

SSL/TLS保护需要openssl扩展,但不可用

解决方案是通过在php.ini中取消注释
extension=php\u openssl.dll
来启用ssl

我这样做并重新启动了xampp,但问题仍然存在

然后在
Cli
中,我执行了
php--ini

它给出了从E:/xampp/php/php.ini加载的配置文件。我的magento在D:/xampp/localhost中的位置

这意味着,虽然magento安装在D驱动器中,但在我的例子中,php.ini是从另一个xampp(E:/xampp/php/php.ini)读取的

我在E:/xampp/php/php.ini中取消了对extension=php_openssl.dll的注释,我的问题得到了解决

因此,在php.ini中启用openssl,从中读取所有php设置。要知道该文件,请在
Cli
中执行
php--ini

如果问题没有解决,请在此处进行评论