For a one-time troubleshooting page 502, page 502 Troubleshooting _php Tutorial

Source: Internet
Author: User
Tags phpinfo

For a one-time troubleshooting page 502, page 502 troubleshooting


First, Scene: System Deepin 15;php 5.5.33;nginx 1.9.9

Second, the situation: simple page output normal (such as phpinfo ();), run any of the company's projects, are 502

Third, the investigation

1, query various logs, including Nginx.error.log, Php_error.log, Php-fpm.error.log, find 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 PHP-FPM process, the Php-fpm.ini made the following changes

(This step is the same as many solutions on the web, but it has no effect)

Pm.max_children =Pm.start_servers = Pm.min_spare_servers =tenpm.max_spare_servers =Pm.process_ Idle_timeout = 10spm.max_requests =    

3, after a large number of queries, there is said that the number of Linux file handle is insufficient

(Forget to keep the URL and change the place, after a toss and no effect)

4, regression Php-fpm.error.log, through exited with code 127 to find

(http://www.faqs.org/docs/abs/HTML/exitcodes.html)

5, based on the previous step to think of using Strace to track the PHP-FPM process, methods divided into two

(In fact, this step should be tried, Rango http://rango.swoole.com/archives/340)

5.1, set the PHP-FPM process number limit to 1, and then directly strace-p 123456 to track a single process

5.2. Use the following command to track the process in bulk

Ps-ef | grep FPM | awk ' {print '-P ' | Xargs Strace

Because the problem is their own machine, no one else to access, so use the second method for tracking, some of the 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", +}, {":", 2}, {"Symbol lookup error", +}, {":", 2}, {"/usr/local/p Hp/lib/php/extension "..., +," {":", 2}, {"Undefined symbol:mmc_queue_pop", +}, {"", 0}, {"", 0}, {"\ n", 1}], 10) = 145 [PID  6744] Exit_group (127)             =?    

Set to the error message undefined Symbol:mmc_queue_pop

6, since it is memcache expansion error, then began to toss, 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 makes clean #但存在多次编译安装时, it's best to clear sudo makesudo make install

Look carefully and find out./configure a WARNING.

Configure:WARNING:You would need re2c 0.13.4 or later if you want to regenerate PHP parsers.

Then began to complement RE2C, and recompile memcache, restart PHP-FPM, but still error

7, finally found an article, said that "My memcache is originally from the official website of the beta version, re-download a stable version of the installation of the problem is OK."

And I use is the beta version of the memcache-3.0.8, so immediately download stable version of the memcache-2.2.7 recompile, the problem successfully resolved.

(http://www.phpjiayuan.com/77/433.html)

IV. Special statement: The articles mentioned in this article, in part from a development group of the Great God, in this acknowledgement!

Five, PostScript: This issue is not only exists in PHP 5.5.33 + memcache-3.0.8 (Beta), pending follow-up

http://www.bkjia.com/PHPjc/1112056.html www.bkjia.com true http://www.bkjia.com/PHPjc/1112056.html techarticle For a Troubleshooting page 502, page 502 Troubleshooting one, Scene: System Deepin 15;php 5.5.33;nginx 1.9.92, Condition: Simple page output is normal (such as phpinfo ();), run the public ...

  • Contact Us

    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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.