A few days ago encountered such a problem, PHP code unchanged, the requested parameters fixed. But
The first request, returns the data to be normal;
Second request, incorrect return data;
Third request, the returned data is not the same as the data returned on the second request
Fourth request, the returned data is correct and consistent with the first request returned data
Problem: PHP request Redis Code is fixed, the requested parameter is also fixed, but the return data is also different.
The code for PHP is as follows:
$redis = new Redis ();
$redis->pconnect (C (' Redis_host '), C (' Redis_port '));
$islive = $redis->hget (' Anchor_online ', $channelid);
$tmp = Json_decode ($islive, true);
Finally, change the pconnect in the code into connect. Solve the problem.
The code after the change is as follows:
$redis = new Redis ();
$redis->connect (C (' Redis_host '), C (' Redis_port '));
$islive = $redis->hget (' Anchor_online ', $channelid);
$tmp = Json_decode ($islive, true);
Multiple requests, the returned data is consistent, and is correct.
There may be other solutions that can be used to make pconnect work (no trial):