For troubleshooting on page 502, page 502
I. Scenario: Deepin 15; php 5.5.33; nginx 1.9.9
Ii. Status: the simple page output is normal (for example, phpinfo ();), running any project of the company, 502
Iii. troubleshooting
1. query various logs, including nginx. error. log, php_error.log, php-fpm.error.log, find the php-fpm error as follows
[22-Mar-2016 11:06:32] WARNING: [pool www] child 3665 exited with code 127 after 24.657496 seconds from start[22-Mar-2016 11:06:32] NOTICE: [pool www] child 3676 started
2, the first thought is caused by the number of php-fpm process is insufficient, the php-fpm.ini to make the following changes
(This step is the same as many online solutions, but it is ineffective)
pm.max_children = 20pm.start_servers = 10pm.min_spare_servers = 10pm.max_spare_servers = 20pm.process_idle_timeout = 10spm.max_requests = 500
3. After a large number of queries, the number of Linux file handles is insufficient.
(If you forget to retained the url and the changes, it will not work after some tossing)
4. Regression php-fpm.error.log, found through exited with code 127
Http://www.faqs.org/docs/abs/HTML/exitcodes.html)
5. Based on the previous step, I remembered using strace to track the php-fpm process. There are two methods:
(In fact this step should have been tried, Rango http://rango.swoole.com/archives/340)
5.1 set the php-fpm process count limit to 1, and then trace a single process directly by strace-p 123456.
5.2 directly use the following command to track processes in batches
ps -ef | grep fpm | awk '{print "-p " $2}' | xargs strace
Because there is a problem with your own machine and no one else accesses it, use the second method for tracking. Some results are as follows:
[pid 6744] fstat(5, {st_mode=S_IFREG|0644, st_size=5016, ...}) = 0[pid 6744] mmap(NULL, 5016, PROT_READ, MAP_SHARED, 5, 0) = 0x7f132588f000[pid 6744] munmap(0x7f132588f000, 5016) = 0[pid 6744] close(5) = 0[pid 6744] writev(2, [{"php-fpm: pool www", 17}, {": ", 2}, {"symbol lookup error", 19}, {": ", 2}, {"/usr/local/php/lib/php/extension"..., 71}, {": ", 2}, {"undefined symbol: mmc_queue_pop", 31}, {"", 0}, {"", 0}, {"\n", 1}], 10) = 145[pid 6744] exit_group(127) = ?
The error message is undefined symbol: mmc_queue_pop.
6. Since the memcache extension reports an error, it starts to throw, starting from the basic compilation command.
Cd/data/memcache-3.0.8/
/Usr/local/php/bin/phpize./configure -- with-php-config =/usr/local/php/bin/php-config
# Sudo make clean # when there are multiple compilation and installation times, it is best to clear sudo makesudo make install
Search carefully and find that./configure reports a WARNING
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
So I started to complete re2c, re-compile memcache, and restart php-fpm. However, an error is still reported.
7. Finally, I found an article and mentioned, "My memcache was originally a beta version from the official website. It is okay to download a new stable version and compile and install it"
And I used is the beta version of the memcache-3.0.8, so immediately download the stable version of The memcache-2.2.7 re-compilation, the problem was successfully solved.
Http://www.phpjiayuan.com/77/433.html)
4. Special Note: some of the things mentioned in this article come from a development group and thank you!
V. Postscript: does this problem only exist in php 5.5.33 + memcache-3.0.8 (beta), to be followed up