Workaround for PHP to be truncated when the content is too long

Source: Internet
Author: User
Tags truncated

Background

Sunday to upgrade the version of the blog to the latest, by the way, the new deployment of Nginx and PHP environment. The PHP7 is used. When you newly deploy your environment, you find that the edit box does not display correctly when you originally published your blog post.

Analysis

Looked at the HTML source code, found that the HTML source code was truncated. As a result, the content of the Web page is not fully displayed.

After the entire analysis process around a large circle, that is, tcpdump, but also with the Tcpflow network packet analysis. Finally, the clues are found in the Nginx error log.

The following information is found in the Nginx error log:

2016/03/29 06:08:10 [Crit] 7042#0: * * () "/var/lib/nginx/tmp/fastcgi/4/00/0000000004" failed (13:permission denied) While reading upstream, client:117.72.224.240, server:www.bo56.com, Request: "get/wp-admin/post-new.php http/1.1", UPS Tream: "fastcgi://127.0.0.1:9010", Host: "Www.bo56.com", referrer: "http://www.bo56.com/wp-admin/edit.php"

The error log displays, Permission denied, stating no permissions. Set this directory to 775 permissions problem resolution. The Web page also appears as normal. If PHP returns too large, Nginx will save a portion of the content into a text file, and so on after all the content is received, and then sent to the client.

When using the Tcpdump capture packet analysis, it is found that the NGINX process actively sends the reset identity to the PHP process, terminating the communication. It is possible that the connection was closed when Nginx found a problem with the permissions. Just guessing, no validation. The figure is as follows:

  • Related Article

    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.