2017-09-04 1 views
0

PHP 버전 7.0.23-1 + ubuntu16.04.1 + deb.sury.org + 1 생성 오류를 사용하여 sudo bash를 사용하여 스크립트 설치하기. 이것은 Nginx 설정 파일입니다.Nginx 설정에서 PHP로 sudo bash 스크립트로 설치

#CREATING NGINX CONFIG FILES FOR EXAMPLE.COM 
      tee /etc/nginx/sites-available/$example_com << EOF 
    server { 
      listen 80; 


      root /var/www/$example_com; 
      index index.php index.html index.htm; 

      server_name $example_com; 

      location/{ 
        try_files \$uri \$uri/ /index.php?q=\$uri&\$args; 
      } 

      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_pass 127.0.0.1:9000; 
        # With php7.0-fpm: 
        fastcgi_pass unix:/run/php/php7.0-fpm.sock; 
        fastcgi_index index.php; 
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
        include fastcgi_params; 
        } 
     } 
    EOF 
      ln -sF /etc/nginx/sites-available/$example_com /etc/nginx/sites-enabled/$example_com 
      rm -rf /etc/nginx/sites-available/default &>> /dev/null 
      service nginx restart >> $TEMP 2>&1 
      if [ $? -eq 0 ]; then 
        ee_info "Nginx is successfull installed" 
      else 
        ee_fail "ERROR! Use:>>>sudo nginx -t<<<< in Terminal" 
      fi 
      service php7.0-fpm restart >> $TEMP 2>&1 
      ee_fail "The above is your config file." 

서버에서 전체 스크립트를 실행하는 동안이 오류가 발생합니다.

[email protected]:/home/ubuntu# nginx -t 
nginx: [emerg] invalid number of arguments in "fastcgi_param" directive in /etc/nginx/sites-enabled/test1.com:28 
nginx: configuration file /etc/nginx/nginx.conf test failed 

이 문제를 해결하는 데 도움을주세요.

+0

에 대한 $을 탈출하지 않았다에게 있습니다 오류가 fastcgi_param 파일에 보인다. 이 파일의 내용을 표시하십시오. – BenRoob

답변

0

문제는이 문장

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 

당신이

fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; 
관련 문제