I have a Laravel 5.7 project and use redis for some caching. I have problem with redis driver predis vs phpredis. Predis often work well since it more simple (?) But phpredis not work (this one faster). This is due to my Dev server not use php-fpm as Production. So I forgot restart php-fpm to reflect phpredis install.
This one reveal some good lessons.
First, production rarely restart so we have manually restart php-fpm.
Second, I have often check open port using netstat -pentl (sudo optional)
And I assumed that php-fpm run on TCP port 900 or 900x because I see many setup forlow this way. So when list port open, I do not see 900x and think server not use php-fpm.
My mistake reveal when I use ps aux and grep fpm. So ut use default setting, run over Unix socket .sock. Knowing system use php-fpm and I instanly understand why my phpredis install not work.
Third, this is interesting. On the way to investigate why prod server not recognize phpredis. I try raw php and ut seem work well. Have no idea, I try create new laravel project with phpredis driver, and you know what?
It's also work, but I use php artisan serve to run debug project. And it's different from serve with Apache. Apache use php-fpm, so without restart php-fpm, phpredis driver not take effect. So next time to debug PHP-Apache make sure you have same config.
This issue is one of the problem during our upgrade laravel and optimize something.
Upgrading lavel from 5.7
to 6.18 LTS (6.2?) have issues with Eloquent relationship... This is another story.
https://stackoverflow.com/questions/33973967/why-do-i-have-to-run-composer-dump-autoload-command-to-make-migrations-work-in
https://apple.stackexchange.com/questions/14163/how-to-configure-terminal-to-be-putty-like-when-it-comes-to-copy-paste-with-mo
select count(distinct `user_id`) as aggregate from `UserFollowData` where `UserFollowData`.`follow_user_id` = '575fcaaa4518e' and `UserFollowData`.`follow_user_id` is not null and exists (select * from `UserData` where `UserFollowData`.`user_id` = `UserData`.`user_id` and `UserData`.`deleted_at` is null);
select count(*) as aggregate from `UserFollowData` where `UserFollowData`.`user_id` = '575fcaaa4518e' and `UserFollowData`.`user_id` is not null and exists (select * from `UserData` where `UserFollowData`.`follow_user_id` = `UserData`.`user_id` and `UserData`.`deleted_at` is null);
yeah dam mis information:
Running the composer install uses the composer. lock file, which now has the “lock” on all packages you have installed on the project. ... In the case of composer update , it does not use the lock file, instead it uses the composer. json file and updates the packages(if updates have been released in the last 3 months).
Comments
Post a Comment