skip to Main Content

I am working on a project with setup PHP7.3, Drupal 6.4 with memcached. Memcached is working in server and in my local machine with windows. But I am not able to make it work in my Mac machine. I followed the below link to make this work.

https://www.journaldev.com/1/install-memcached-mac

And I tried

brew install memcached

Also.

Then added

[memcached]
 extension="memcached.so"

In php.ini file. Then restarted apache. After this on the first run I got the error

{"Error Details":{"Message":"n Error code : 32n Message : PHP Startup: Unable to load dynamic library ‘memcached.so’ (tried: /usr/local/lib/php/pecl/20180731/memcached.so (dlopen(/usr/local/lib/php/pecl/20180731/memcached.so, 9): image not found), /usr/local/lib/php/pecl/20180731/memcached.so.so (dlopen(/usr/local/lib/php/pecl/20180731/memcached.so.so, 9): image not found))n File name : Unknownn Line no : 0n Date :12-March-21 02:45:05n Path : http://localhost/mysite/?q="}}

But from the second run onwards the error is not there. But memcache is not working. And I can’t find the memcached.so file in my system.

How can I fix this? Please help

2

Answers


  1. Have you remembered to start the service?

    brew services start memcached

    Login or Signup to reply.
  2. I tried this. It helps.

    https://izziswift.com/how-to-install-memcached-module-for-php7-1-on-macos-high-sierra/

    1. pecl bundle memcached
    2. Change to the directory it output.
    3. phpize
    4. Make sure libmemcached and zlib are installed (brew install libmemcached zlib).
    5. Get the zlib directory (brew list zlib).
    6. ./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11/ (replace the zlib path with the one from the previous command).
    7. make
    8. make install
    9. Add the extension line in your php.ini file (ex. change the paths to match what make install output. I added this to my /usr/local/etc/php/7.4/conf.d directory in a file called ext-memcached.ini.
    [memcached] 
    extension=memcached.so
    
    1. Verify you installed the module php -m should show you memcached in the outputted list.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search