>  기사  >  백엔드 개발  >  LEMP 환경 구축에 대한 몇 가지 질문

LEMP 환경 구축에 대한 몇 가지 질문

WBOY
WBOY원래의
2016-09-23 03:30:11800검색

ubuntu 12.04 버전에서 LEMP 환경을 설정했습니다. 온라인 튜토리얼을 따라 단계별로 구성했습니다. index.php에 액세스하면 계속 404 NOT FOUND 오류가 보고되는 것을 발견했습니다(파일 이름이 index.php로 다시 변경된 경우). html로 정상적으로 접근이 가능합니다. 해결방법을 알려주세요.
cgi.fix_pathinfo=0 및 listening = /var/run/php5-fpm.sock이 PHP 관련 구성 파일에 설정되어 있습니다.
nginx 구성 정보는 다음과 같습니다.

<code>server {
    listen       80;


    root   /vagrant/www/;
    index  index.php index.html index.htm;

    server_name localhost;

    error_page 404 /404.html;
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/www;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    location ~ \.php$ {
         try_files $uri =404;
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
         fastcgi_pass unix:/var/run/php5-fpm.sock;
         fastcgi_index index.php;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         include  fastcgi_params;
    }
}</code>
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.