Answer by Orlando Dejesus
Stack Overflow for Teams
Where developers & technologists share private knowledge with coworkers
,This is a version mismatch. You’re using the 64-bit php_redis.dll instead of the 32-bit. Download and paste the 32-bit version for php 5.3-5.6 from here into your php/ext folder and add the following line to your php.ini:,I’m using php 5.4.12 which installed extension php_redis and php_igbinary that was downloaded at https://github.com/nicolasff/phpredis/downloads. ,There are 2 version: thread version and non thread version. First i try with the first one. Copy 2 file php_redis and php_igbinary to ext folder of php, edit php.ini config for load extension and seem to successful
This is a version mismatch. You’re using the 64-bit php_redis.dll
instead of the 32-bit. Download and paste the 32-bit version for php 5.3-5.6 from here into your php/ext
folder and add the following line to your php.ini
:
extension=php_redis.dll
Answer by Paityn Pacheco
@char101 has been awesome about building the phpredis windows binaries, and may be able to provide more insight.,The ini file where you’re adding the extension reference is the wrong one. You can test this by putting some bad value in there (like extension=this_is_not_an_extension.dll and see if you get an error message when you run PHP from the command line,
The ini file where you’re adding the extension reference is the wrong one. You can test this by putting some bad value in there (like extension=this_is_not_an_extension.dll and see if you get an error message when you run PHP from the command line
,
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
The ini file where you’re adding the extension reference is the wrong one. You can test this by putting some bad value in there (like extension=this_is_not_an_extension.dll
and see if you get an error message when you run PHP from the command line
extension=this_is_not_an_extension.dll
Answer by Dennis Rhodes
The problem is that the redis class cannot be captured in the message
,[Solved] Fatal error: Uncaught Error: Class ‘Imagick‘ not found,Mac PHP Fatal error: Class ‘Memcache’ not found,However, I have installed redis and used it in PHP code, but when I execute PHP jifen.php in Linux system, I report that redis class cannot be found.
First, determine if there are two PHP in your system.
find/-name php
Modify the system environment file:/etc/profile
vi /etc/profile
Write the PHP environment address to the end of the configuration file
The PHP runtime files are inside the bin directory, so mine is: /www/server/php/73/bin/
export PATH=$PATH:your PHP address
Save, exit, and then run:
source /etc/profile
Answer by Karsyn Watson
Under ubantu, it is false, and remote access with windows is true. It’s strange,class_exists(‘\Redis’)
If false is returned, it is the problem of the environment. Check it again,
Oh, do you see that the PHP version of FPM is the same as that of CLI,
See the IOS interview question set, including face-to-face experience and video explanation (continuously updated)
,Is it because PHP FPM is not installed?
So,
new \Redis();
Answer by Bryan Horton
**Fatal error** : Uncaught Error: Class ‘Redis’ not found in /var/www/emoncms/index.php:34 Stack trace: #0 {main} thrown in **/var/www/emoncms/index.php** on line **34**,I saw that redis was disabled in /var/www/emoncms/settings.php, but if I enable it, I get,I therefore assume that php is not finding php-redis.,Process ‘process__kwh_to_power’ not available. Redis not installed.
I was getting the following error message in emoncms:
Process 'process__kwh_to_power' not available. Redis not installed.
Process 'process__kwh_to_power' not available. Redis not installed.
Answer by Keira Juarez
Well, not sure if gdb will get this error, with him you can fine what is cuasing for example seg faults, maybe you will find what’s causing fatal errors too.,I have no idea, only solution i have — check this code in cli using gdb and check which is previous call before fatal error in php enviroment.,I suspect there is problem with some Phalcon Framework class which handle Redis. But I have no idea how to fix it. Other libraries which use Redis work fines, generally Redis server works good. Any idea?
I use modelsCache such way:
$di->setShared('modelsCache', function () {
$frontCache = new DataFrontend([
'lifetime' => 3600 * 24 * 7
]);
$redis = new \Phalcon\Cache\Backend\Redis($frontCache, [
'host' => $this->get('config')->redis->host,
'port' => $this->get('config')->redis->port,
'auth' => $this->get('config')->redis->password
]);
return $redis;
});
and I got error:
Fatal error: Class 'redis' not found in /home/www/apps/models/entities/Company/Company.php on line 421
This line is:
$company = Company::findFirst([
'cache' => 'company_cache_key'
]);
This code return true:
class_exists('\Phalcon\Cache\Backend\Redis');
- Laravel Version: 6.0.3
- PHP Version: 7.3.9
- Database Driver & Version:
php-redis 5.0.2-2
redis 5.0.5-1
Description:
I’ve starting to upgrade from 5.8 to Laravel 6.0. As recommended by the docs I’ve moved to phpredis
.
I already removed the Redis alias, but it keeps using the wrong driver (at least I think so):
Steps To Reproduce:
- Upgrade to 6.0
- Removed predis
- Update all configs, including
'client' => env('REDIS_CLIENT', 'phpredis'),
If more info is needed, please let me know.
Я использую PHP 5.4.12, в котором установлены расширения php_redis и php_igbinary, загруженные по адресу https://github.com/nicolasff/phpredis/downloads.
Существует 2 версии: версия с резьбой и версия без резьбы. Сначала попробую с первым. Скопируйте 2 файла php_redis и php_igbinary в папку ext php, отредактируйте конфигурацию php.ini для расширения загрузки и, похоже, все прошло успешно
После этого я запускаю myfile.php с командой: $redis = new Редис(); -> возникла фатальная ошибка: CLASS REDIS НЕ FOULD.
Я пробовал использовать другие версии (не потоковые), но у меня получилось похожее.
Кто-нибудь знает об этом
Спасибо заранее
ОБНОВЛЕНИЕ:
Я смотрю журнал ошибок Apache. Получил это:
PHP Warning: PHP Startup: Unable to load dynamic library ‘c:/wamp/bin/php/php5.4.12/ext/php_igbinary.dll’ — %1 is not a valid Win32 application.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library ‘c:/wamp/bin/php/php5.4.12/ext/php_redis.dll’ — %1 is not a valid Win32 application.\r\n in Unknown on line 0
Подробнее здесь: https://stackoverflow.com/questions/236 … ws-machine
Read the article to find out the “uncaught error class ‘Redis’ not found.” Bobcares, as a part of our Server Management Service offers solutions to every Redis query that comes our way.
The “uncaught error class ‘redis’ not found” issue
When PHP is unable to locate the Redis extension, which is necessary to access the Redis functionality in the PHP code, the error message “Uncaught Error: Class ‘Redis’ not found” frequently appears.
Troubleshooting “uncaught error class ‘redis’ not found”
1. First, make sure the server has the Redis extension installed. PHP does not come with the Redis extension by default; we must install it individually.
2. We can install the Redis extension based on the server’s operating system and package manager. We need to restart the web server after installing the extension in order for the modifications to take effect.
3. Make sure that the PHP configuration has the Redis extension enabled. Also, make sure the line that loads the Redis extension is uncommented by opening the php.ini file.
4. Restart the web server after making modifications to the php.ini file.
5. If we want to check if the Redis extension is listed and enabled, we can construct a PHP script that contains phpinfo() and visit it from the browser. To find the Redis section, type “redis” into the page’s search bar.
6. Make sure the code doesn’t contain any instances of the class “Redis” with the same name. Having a naming dispute may result in this problem.
7. Also, ensure the autoloading is configured appropriately to load the Redis extension if we’re using a PHP framework.
8. Confirm we are interacting with Redis using the correct class and method names.
9. Finally, verify that the Redis extension we installed is compatible with the version of PHP we are using.
[Want to learn more? Reach out to us if you have any further questions.]
Conclusion
The article outlines some of the steps from our Tech team in order to fix the “uncaught error class ‘redis’ not found” issue.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
GET STARTED
When you set up a new Laravel application to use Redis as a cache driver or broadcast driver, you may encounter the following error:
Why Does This Error Occur?
The reason for this error is usually either a missing Composer package or a missing Redis installation. In both cases, it appears once you try to use Redis in your system for the following:
- Cache driver by setting
CACHE_DRIVER=redis
- Broadcast driver by setting
BROADCAST_DRIVER=redis
Before going into the solutions, make sure you need Redis in your system. If you don’t use it, you should change your drivers to something else.
Missing Composer Package
This is the most common reason to have this error. To fix it, run the following command:
composer require predis/predis
And once the package is installed, you should be able to use Redis as a cache or broadcast driver.
Missing Redis Installation
If you have installed the package, but the error is still there, you may need the Redis installation. To install Redis, follow the instructions on the official Redis website.