4
votes

I installed Redis extension from here. My console see redis installed, when I run php -i I see

redis Redis Support => enabled Redis Version => 2.2.7

When I try to create instance of Redis class I get Fatal error: Uncaught Error: Class 'Redis' not found.

phpinfo() shows thay my php.ini file is in /usr/local/php5/lib/php.ini.

I found solution here buy it doesn't work. I also copied extension path from php-cli ini.

All extension paths which I tried to use are:

  • extension = redis.so
  • extension = /usr/local/php5/lib/php/extensions/no-debug-non-zts-20151012/redis.so
  • extension = /usr/local/opt/php55-redis/redis.so

Could anyone help me?

1

1 Answers

5
votes

so strange when you saw Redis but still failed. Just this line is enough:

extension = /usr/local/opt/php55-redis/redis.so

Then check php -v, make sure no error related to redis happen.

Or try installing by brew install php55-redis (I did successfully).

-- note that in OSX El Capitan you have to update brew (xcode-select --install)

-- (for Apache) Make sure the php5_module is loaded correctlly:

  1. open /etc/apache2/httpd.conf

  2. search for php5_module, replace the current path to /usr/local/Cellar/php55/5.5.xx/libexec/apache2/libphp5.so (5.5.xx is the version when you type php -v)

If still failed anyway, restart MAC :((

-- If you install by brew but error, give me some comments.