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. API Platform 2.0 released: creating powerful web APIs has never been so easy
  2. Be paid to improve API Platform during the Rails Girls Summer of Code
  3. DunglasTodoMVCBundle compatible with Symfony 2.4
  4. API Platform 2.2: GraphQL, JSON API, React admin and PWA, Kubernetes instant deployment and many more new features

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 ReplyCancel reply

Social

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

Links

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

Subscribe to this blog

Top Posts & Pages

  • Symfony's New Native Docker Support (Symfony World)
  • JSON Columns and Doctrine DBAL 3 Upgrade
  • Securely Access Private Git Repositories and Composer Packages in Docker Builds
  • Develop Faster With FrankenPHP
  • Preventing CORS Preflight Requests Using Content Negotiation
  • FrankenPHP: The Modern Php App Server, written in Go
  • Generate a Symfony password hash from the command line
  • PHP and Symfony Apps As Standalone Binaries
  • How to debug Xdebug... or any other weird bug in PHP
  • Running Laravel Apps With FrankenPHP (Laracon EU)

Tags

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

Archives

Categories

  • DevOps (84)
    • Ubuntu (68)
  • Go (17)
  • JavaScript (46)
  • Mercure (7)
  • Opinions (91)
  • PHP (170)
    • API Platform (77)
    • FrankenPHP (9)
    • Laravel (1)
    • Symfony (97)
    • Wordpress (6)
  • Python (14)
  • Security (15)
  • SEO (25)
  • Talks (46)
© 2025 Kévin Dunglas | Powered by Minimalist Blog WordPress Theme