Linux PHP page open report 404 File not Found

Source: Internet
Author: User

Installed in the local virtual machine, and installed the LNMP environment, the installation is normal, boot is normal, but found the configuration number Nginx, open the PHP page prompt file not found, but access to the HTML page does not affect .

On the internet to find all kinds of information, said let the

Fastcgi_param  script_filename          /script$fastcgi_script_nam

Modified to:

Fastcgi_param  script_filename        $document _root$fastcgi_script_nam

But my nginx configuration has been changed to $document _root, so this method is not suitable for my problem.

This solution is everywhere on the web, and I finally found another solution when I had to give up a few degrees.

The scheme says:selinux Authority problem is caused!

PHP-FPM when accessing the index.php file under the Web directory, it was blocked by SELinux, and access was prevented, so there was a case where the file not found was first said.

can be in the WWW directory with ls-z View permissions, there are two options on the net, one is to turn off SELinux directly, the other is to change permissions, because I use the virtual machine, there is no security issues, so take a straightforward simple rough off the selinux solution.

Two ways to turn off selinux

The first type, temporarily closed, does not require a restart, restart will open

0

The second is to shut down from the configuration and need to restart

Vim/etc/sysconfig/selinux

Set the disabled to OK.

Solution Source Address: http://blog.csdn.net/u012511616/article/details/52735539

Linux PHP page open report 404 File not Found

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.