2016-07-29 119 views
1

我剛在Windows 7(64位)上安裝了Magento 2 & WAMP(PHP VER。7.0.4)。Magento 2(cmd) - 致命錯誤:未捕獲錯誤:未找到'Cli'類

之後,我試圖使用以下命令清理和清理緩存。

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 cache: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錯誤,但我不出來...

讓我知道,如果你想了解更多信息...

回答

1

檢查是否安裝OpenSSL在系統使用命令如下:

dpkg -l | grep -i openssl 

如果你沒有得到任何與此命令..這意味着你需要安裝OpenSSL。

另一種選擇是你可以在你的php.ini配置文件中取消註釋代碼extension = php_openssl.dll

我希望這可以幫助你。

0

我也在我的本地主機上面對Magento2.1.2中完全相同的問題。

The openssl extension is required for SSL/TLS protection but is not avaialable

解決方案是通過在您的php.ini中取消註釋extension=php_openssl.dll來啓用ssl。

我做到了這一點,並重新啓動我的xampp,但問題仍然存在。

然後在Cli我執行php --ini

它給E:/xampp/php/php.ini中的Loaded Configuration File。作爲我的magento在D:/ xampp/localhost。

這意味着,雖然Magento的安裝在d驅動器,但在php.ini從另一個XAMPP(E:/xampp/php/php.ini)看在我的情況。

我在電子商務取消註釋extension=php_openssl.dll:/xampp/php/php.ini和我的問題得到解決。

因此,在php.ini中啓用openssl,從中讀取所有php設置。要知道該文件執行php --iniCli

評論這裏,如果它沒有得到解決。

相關問題