PHP 5.3 and PHPRedis were installed on the server, the usual code on the pages is <?php $redis = new Redis(); $redis->connect('127.0.0.1', 6379); <?php $redis = new Redis(); $redis->connect('127.0.0.1', 6379); Everything worked fine. For technical needs, I had to switch to 5.5, but when I load the page it now shows:

 Fatal error: Class 'Redis' not found 

Moreover, the PHP version in the console remained 5.3, and the page opens in 5.5. Accordingly, the command in the console itself: php -r "if (new Redis() == true){ echo \"\r\n OK \r\n\"; }" does not give an error. What can I do, reinstall phpredis again, or can I register something?

    2 answers 2

    Run composer dump-autoload. Try using $redis = new \Redis(); instead of $redis = new Redis() $redis = new \Redis(); And make sure the require 'vendor/autoload.php';

      All just write one line - to connect this class

       unclude_once(__DIR__ .'/RedisClass.php'); 

      only you need to understand from which file it is called and which path to the file with the class REDIS

      maybe autoloading of your class has "flown" - remake it to the new standards http://php.net/Autoload

      • to find where from: D - sferos corp
      • well, that's easy. For example, in Notepad ++ there is a search in files Ctrl + Shift + f for this you need to download files to your computer and run a search in these files for example class Redis - Mcile
      • Maybe it can help, now it gives out when issuing a call to phpredis: PHP Warning: Module 'redis' already loaded in Unknown on line 0 - sferos corp
      • Document found, include_once('/tmp/phpredis/redis.c'); But now just the entire text of the document displays on the screen - sferos corp
      • I apologize, but the .c file format - I specialize in C / C ++ source code in .php files - Mcile