Experimental purpose
According to the article "PHP Bypass open_basedir Column Directory Research" by testing the different configurations to verify that the method of bypassing Basedir is valid, so that the purpose of security configuration PHP Open_
1, nginx shell script put to/etc/init.d/under the name Nginx#!/bin/SH# # Nginx-This script starts and stops the Nginx Daemon # # Chkconfig:- - the# Description:nginx is an HTTP (s) server, HTTP (s) reverse # Proxy and IMAP/POP3 Proxy Server #
# in Nginx and PHP-FPM next visit Nginx on the instant 502 question Php-fpmsignal 7 (Sigbus)
Failure phenomenon
Use the tinkphp3.2.x frame, the page occasionally appear a visit Nginx on the report 502 bad Gateway, not wait for a period of time
The 502 error is the one that all nginx running PHP don't want to see.
Nginx 502 has many reasons, but most of the reasons can be attributed to the lack of resources, that is, the back-end php-fpm processing problems, nginx the correct client
The biggest problem with NGINXPHP-FPM configuration is the problem of internal leakage: The server is not load, but the memory consumption increased rapidly, quickly ate memory and then began to eat the swap partition, the system quickly hung
On the Saturday game not to go, their own tools to test, the hint 502 bad gateway error, not know how the whole, unexpectedly put the server restarted, and so the boss of the verification code, tossing the majority of days, in fact, not so, direct
1. nginx configuration file pathGenerally, when installing nginx, the default path of the configuration file is/usr/local/nginx/conf/nginx. conf.We can use a link file to direct the conf directory to a specific directory for convenient management.
Everything is based on the principle of simplicity, yum/rpm, and never compiled manually :)The deployment environment is based on the CentOS 6.3 x86_64 system.0. Preparations
# Update yum [root @ imysql ~] # Yum-y update [root @ imysql ~] # Yum
Today, this is a piece of work on CentOS. When you visit a page all the time, the browser prompts you to be OK. And accessing the HTML suffix is the normal occurrence of the content.
However, the access to the PHP suffix is returned to a blank
1.
Problem:
The limit number of open file descriptors defined in the/usr/local/webserver/php/etc/php-fpm.conf file is found
51200
But with the command ulimit-n view, found only 1024
I have added a/etc/rc.local in theUlimit-shn 51200
It
Recv () failed (104:connect reset by peer) while reading response headers from upstream reasons and solutionsThe reason is that the number of PHP-FPM processes is exhausted, two scenarios:(1). Adjust the php-fpm.conf inside the Pm.max_children,
When we compile and install php in linux. /configure, a lot of binary files will be generated under the php Directory, find php/sapi/fpm/init. d. php-fpm,Then cp/root/php/sapi/fpm/init. d. php-fpm/etc/init. d/php-fpm. The file content is as follows:
For a long time not installed PHP environment, a long time no manual configuration Lnmp environment, today let me have a headache!
However, with the passage of time, more and more libraries in the source of Yum can be used directly, now in the
After buying an ECS, the system automatically installs nginx 1.6 + php 5.3.28 + mysql 5.5After the PHP program is put into the ECS, the first test program access is normal and the speed is normal. However, after you put the program online for access,
php-cgi, why not? What does the PHP-FPM child process do?PHP-CGI is the original PHP comes with the FASTCGI process Manager, there are some shortcomings, such as not smooth restart, process management poor.PHP-FPM can be seen as an upgraded version
Installing NginxInstall PHPCheck the currently installed PHP packageIf you have a PHP package installed, remove them first[email protected] ~]# Yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring . x86_64
This afternoon configuration nginx+php environment, ready to put a WordPress play. But after the layout of the page PHP page has been blank, at first I thought it was a matter of permissions, the right to change to 755 after still not. Then I opened
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.