我的nginx 和php-fpm 都有啟動。但是仍然報錯,google後仍然無果,萬能的社區,求助啊!
查看資訊
設定檔如下:
報錯資訊如下:
回複內容:
我的nginx 和php-fpm 都有啟動。但是仍然報錯,google後仍然無果,萬能的社區,求助啊!
查看資訊
設定檔如下:
報錯資訊如下:
建議你每個項目定一個網域名稱 一個目錄
sudo vi /etc/hosts//添加127.0.0.1 demo.dev
開啟 /usr/local/etc/nginx/servers
然後建立一個設定檔 例如 demo.conf 內容如下:
server { listen 80; server_name demo.dev; #網域名稱 root /Users/程式目錄; #程式目錄 index index.html index.php; # 偽靜態 #location / { # try_files $uri $uri/ /index.php$is_args$query_string; #} location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }}
重啟nginx,瀏覽器訪問demo.dev 大功告成
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
試試。
server { listen 80; server_name localhost; root /path; #注意這裡配置為你的網站根目錄 index index.html index.htm index.php; location / { #try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; }}
建議還是vagrant在mac上面架設lnmp環境. 百度下有很多的解決方案