4

I added

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

to composer.json for an eDirectory Symfony 2.8 app, but it gave me an error:

$ 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.

However, I do have OPcache installed!

$ php -r "phpinfo();" | grep OPcache -a3
Zend OPcache

Opcode Caching => Up and Running
Optimization => Enabled

It doesn't complain about "ext-gd": "*" or "ext-mbstring": "*".

PHP 5.6.27

Chloe
  • 25,162
  • 40
  • 190
  • 357

1 Answers1

11

The extension name is Zend OPcache not OPcache. You need to require it with full name:

"ext-zend-opcache": "*"
rob006
  • 21,383
  • 5
  • 53
  • 74