为什么Composer不使用OPcache?

4

我添加了

"require": {
    "ext-opcache": "*",

我想为一个eDirectory Symfony 2.8应用程序添加composer.json,但它给了我一个错误:

$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested PHP extension ext-opcache * is missing from your system. Install or enable PHP's opcache extension.

然而,我已经安装了OPcache!
$ php -r "phpinfo();" | grep OPcache -a3
Zend OPcache

Opcode Caching => Up and Running
Optimization => Enabled

它不会报错关于"ext-gd": "*"或者"ext-mbstring": "*"

PHP 5.6.27


我们能获取 composer show -p 的输出吗? - ficuscr
尝试重新安装Composer。 - Alex
1个回答

11

扩展名是Zend OPcache而不是OPcache。你需要使用完整名称来引入它:


"ext-zend-opcache": "*"

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接