Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't composer use OPcache?

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

like image 204
Chloe Avatar asked Jan 03 '23 02:01

Chloe


1 Answers

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

"ext-zend-opcache": "*"
like image 93
rob006 Avatar answered Jan 05 '23 00:01

rob006