2017-02-06 4 views
0

mac osでphp Webサイトを提供するためにnginxをセットアップしようとしました。しかし、私はブラウザからPHPファイルを開くと、何のエラーもなく空白のページが表示されます。私はphpとnginx関連のアプリケーションをインストールしました。以下は私のPHPファイルである:以下mac oxでnginxのphpを設定できませんでした

<?php 
phpinfo(); 
?> 

は私のnginxの設定ファイルである:

http{ 
     server{ 
       listen 8082; 
       root /Users/joey/tmp; 
     location/{ 
      index index.html index.htm index.php; 
     } 
       location ~ \.php$ { 
      fastcgi_pass 127.0.0.1:9000; 
      fastcgi_index index.php; 
       include /usr/local/etc/nginx/fastcgi_params; 
         autoindex on; 
       } 


     } 
} 
events { 
    worker_connections 1024; 
} 

私はPHP-FPMが開始されたことverifed、ポート9000でリッスンしている:

$ lsof -Pni4 | grep LISTEN | grep php 
php-fpm 43310 joey 6u IPv4 0xdcff1b2732b9c88d  0t0 TCP 127.0.0.1:9000 (LISTEN) 
php-fpm 43311 joey 0u IPv4 0xdcff1b2732b9c88d  0t0 TCP 127.0.0.1:9000 (LISTEN) 
php-fpm 43312 joey 0u IPv4 0xdcff1b2732b9c88d  0t0 TCP 127.0.0.1:9000 (LISTEN) 
php-fpm 43313 joey 0u IPv4 0xdcff1b2732b9c88d  0t0 TCP 127.0.0.1:9000 (LISTEN) 
以下

私のPHPとnginxのバージョンです:

設定に問題はありませんか?

答えて

0

いくつかの検索は、私はPHPの要求を有効にするためにnginx.confファイルに設定を下回る必要が見つけた後:

location ~ \.php$ { 
         fastcgi_pass 127.0.0.1:9000; 
         fastcgi_param REQUEST_METHOD $request_method; 
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
         fastcgi_index index.php; 
         include /usr/local/etc/nginx/fastcgi_params; 
         autoindex on; 
       } 
関連する問題