PHP Request Nginx Server returned 403

Source: Internet
Author: User

In the CentOS conf/include of the Nginx configuration of a virtual host, no virtual domain name, the default is to use the hostname as the domain name, the port is replaced by a custom port, but always return 403.

In the online search said there are two general reasons, one is the user rights issues, I checked, are the same user group and users, so should not be a permission problem;

The second is the homepage problem, found that the default home page index.html is accessible, should not be the problem, when the PHP page into HTML and the fastcgi_* and other configuration comments out, found to be accessible, so it is not the home page Setup problems But Curl gets the. PHP page is the source code, not the result after execution, so it should be the problem of PHP parsing.

Later found that the original nginx in parsing PHP, need to use the fast-cgi, this thing needs to start PHP-FPM this process to achieve the corresponding services.

Performing PS aux | grep php-fpm Command,

The discovery does not have a corresponding process running, so the execution

After the/USR/LOCAL/PHP5/SBIN/PHP-FPM command, change the annotated fastcgi_* parameter back to remember to perform/usr/local/nginx/nwebctl reload command overload once Nginx configuration, will be able to parse the PHP Web page, and returned is not 403.

PHP Request Nginx Server returned 403

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.