Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common error codes on the server

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you what common server error codes, I believe that most people do not know much, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!

One: 500 error

1. 500 Internal Server Error internal service error: as the name implies, 500 error usually means that the server encounters an unexpected condition and cannot complete the request.

2. The possibility of 500 errors:

A, programming language syntax error, web script error

B. When concurrency is high, too many files cannot be opened because of system resource constraints.

3. General solution:

A. Check the error log files of nginx and php to see the clue.

B. If it is too many open files, modify the worker_rlimit_nofile parameter of nginx, use ulimit to check the file opening limit of the system, modify / etc/security/limits.conf, or too many open files appears, then consider doing load balancing and distributing traffic to different servers.

C. If it's the script, you need to fix the script error and optimize the code.

Two: 502, 504 errors

1. 502 Bad Gateway error, 504 Bad Gateway timeout gateway timeout

2, the possibility of 502, 504

Web server failure, insufficient program process

3. General solution

A, using the nginx proxy, and the backend server fails; or the number of php-cgi processes is not enough; the php execution time is long, or the php-cgi process dies; the fastCGI usage will cause 502,504 errors.

B, 502 means that the requested php-fpm has been executed, but for some reason it is not finished, resulting in the termination of the php-fpm process. Generally speaking, it has something to do with the setting of php-fpm.conf and the performance of the executive program of php. The number of visits to the website is large, while the number of processes in php-cgi is relatively small. For 502 errors in this situation, you only need to increase the number of processes in php-cgi. Specifically, modify the / usr/local/php/etc/php-fpm.conf file to increase the max_ childrenvalue appropriately. This data should be set according to the configuration of your server. Generally, a php-cgi process occupies 20 megabytes of memory. You can calculate by yourself and increase the amount appropriately.

/ usr/local/php/sbin/php-fpm reload and then restart it.

C, 504 indicates a timeout, that is, the request made by the client does not reach the gateway and the request does not reach the executable php-fpm. It is also related to the configuration of nginx.conf.

The 501 server does not have the ability to complete the request. For example, this code may be returned when the server does not recognize the request method.

The above is the common server error code 500, 501, 502, 503, 504, 505 introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave me a message and the editor will reply to you in time. Thank you very much for your support to the website!

The 503 server is currently unavailable (due to overload or downtime maintenance). Usually, this is only a temporary state. (service not available)

The server does not support the version of the HTTP protocol used in the request. (the HTTP version is not supported)

The above is all the contents of the article "what are the common error codes on the server?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report