Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Recently, due to the update of the ubuntu source, the original new source and the local system library lib conflict, resulting in the system desktop display exception, and later only reload, new installation of php5.4.9, also installed redis, php-redis extension, php- Redis extension 2.10. But put the original project one, it will report nginx 502 error (nginx 502 error is really a headache). Open nginx log view
[error] 29229#0: *1403 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server:
I don't know what it is. Later open the php-fpm error log and get the log log
[08-Oct-2013 21:22:23] WARNING: [pool www] child 12026 exited on signal 11 (SIGSEGV - core dumped) after 5.997917 seconds from start
[08-Oct-2013 21:22:23] NOTICE: [pool www] child 12034 started
One thing that can be determined is that php-fpm restarts a process after a point in time. Still no clue. Searched online a lot, there is a useful tracking method.
1, set php-fpm, only one work process
2, restart php-fpm, execute ps aux| grep php-fpm get the work process number pid
3, strace -p pid
Below is the information I got.
Getcwd("/home/www/xxx", 4096) = 26
Lstat("/home/www/xxx/./RWebUser.php", 0x7ffff4e30a10) = -1 ENOENT (No such file or directory)
Lstat("/home/www/xxx/protected/vendor/wms/api/RWebUser.php", 0x7ffff4e30a10) = -1 ENOENT (No such file or directory)
Lstat("/home/www/xxx/protected/vendor/wms/RWebUser.php", 0x7ffff4e30a10) = -1 ENOENT (No such file or directory)
Lstat("/home/www/xxx/protected/extensions/log/RWebUser.php", 0x7ffff4e30a10) = -1 ENOENT (No such file or directory)
Throw new CHttpException(500, "Redis occurs an error:" . $e->getMessage());
With the red code, you will get a 502 error, and with the green code, there is no problem.
setOption Is this a god horse thing? Checked the php-redis api
$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_NONE); // don't serialize data does not serialize data
$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); // use built-in serialize/unserialize Serialization with php built-in
$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_IGBINARY); // use igBinary serialize/unserialize Serialize with extended IGBINARY
$redis->setOption(Redis::OPT_PREFIX, 'myAppName:'); // use custom prefix on all keys redis key prefix
$redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); Use this to report 502
Why use php built-in serialization will go wrong? In the end what happened?
Later, the IGBINARY extension was installed, or not. Finally, php-redis installed the latest version 2.24, and then run, it is no problem.
Copyright statement: This article is the original article of CSDN blogger "Yi Guang Nian", following the CC 4.0 BY-SA copyright agreement, please reprint the original source link and this statement.
Original link: https://blog.csdn.net/tengzhaorong/article/details/12704759
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.