Skip to content

Kévin Dunglas

Founder of Les-Tilleuls.coop (worker-owned cooperative). Creator of API Platform, FrankenPHP, Mercure.rocks, Vulcain.rocks and of some Symfony components.

Menu
  • Talks
  • Resume
  • Sponsor me
  • Contact
Menu

Enabling OPcache for PHP 5.6+ installed with Homebrew

Posted on September 26, 2014 by Kévin Dunglas

PHP

Since 5.5, PHP comes with a built-in OPcache system. This PHP accelerator has been open sourced by Zend and is a good replacement for APC.

If you installed PHP 5.6 on your Mac with Homebrew, you maybe noticed that OPcache is not enabled by default. Even if the extension has been compiled, a manual configuration must be done to enable the extension.

  1. Open /usr/local/etc/php/5.6/php.ini
  2. Add zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/opcache.so at the end of this file
  3. Restart your PHP FPM or Apache if you are using mod_php

You’re dev environment is now blazing fast!

Related posts:

  1. Installer PHP sur OS X avec le support de MySQL et de INTL
  2. Accélérer PHP grâce à APC
  3. PHP Schema: generate a fully functional PHP / Doctrine / Symfony data model from Schema.org vocabulary in minutes
  4. Connection to a MS SQL Server from Symfony / Doctrine on Mac or Linux

5 thoughts on “Enabling OPcache for PHP 5.6+ installed with Homebrew”

  1. Amo__ says:
    January 22, 2015 at 12:19 pm

    Thanks !

    Reply
  2. Amo__ says:
    January 22, 2015 at 12:20 pm

    (Works for php 5.6 btw)

    Reply
  3. baptistemeyer says:
    October 28, 2015 at 8:58 pm

    You need to install the php-opcache package for some time now (since OS X 10.11 El Capitan I think): brew install

    Then you need to enable it in the opcache section of your php.ini: opcache.enable=1

    Finally, restart your PHP-FPM or your Apache.

    Reply
  4. baptistemeyer says:
    October 28, 2015 at 9:01 pm

    Oops, my previous comment has been escaped: brew install php55-opcache or brew install php56-opcache.

    Reply
  5. Dan says:
    February 3, 2017 at 12:59 am

    first install php-opcache,

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Social

  • Bluesky
  • GitHub
  • LinkedIn
  • Mastodon
  • X
  • YouTube

Links

  • API Platform
  • FrankenPHP
  • Les-Tilleuls.coop
  • Mercure.rocks
  • Vulcain.rocks

Tags

Apache API API Platform Buzz Caddy Docker Doctrine FrankenPHP Go Google GraphQL HTTP/2 Hydra hypermedia Javascript JSON-LD Kubernetes La Coopérative des Tilleuls Les-Tilleuls.coop Lille Linux Mac Mercure Mercure.rocks MySQL performance PHP Punk Rock Python React REST Rock'n'Roll RSS Schema.org Security SEO SEO Symfony Symfony Live Sécurité Ubuntu webperf Wordpress XHTML XML

Archives

Categories

  • DevOps (86)
    • Ubuntu (68)
  • Go (21)
  • JavaScript (46)
  • Mercure (7)
  • Opinions (91)
  • PHP (178)
    • API Platform (80)
    • FrankenPHP (16)
    • Laravel (1)
    • Symfony (98)
    • Wordpress (6)
  • Python (14)
  • Security (15)
  • SEO (25)
  • Talks (47)
© 2026 Kévin Dunglas | Powered by Minimalist Blog WordPress Theme