Nginx + PHP Windows安裝)

來源:互聯網
上載者:User
1、安裝 Nginx,

進入conf檔案夾配置nginx.conf 設定http 裡面server屬性

server {
listen 8079;
server_name localhost;

location / {
root e:/Nginx/web/;
index index.html index.htm index.php;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}

#設定php-cgi模式
location ~ \.php$ {
root e:/Nginx/web/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}

2、安裝php (cgi模式)~忽略

3、啟動環境

啟動Nginx:

taskkill /F /IM nginx.exe >nul
start E:\Nginx\nginx-1.8.0\nginx.exe

啟動Fastcgi

e:\Nginx\php5\php-cgi.exe -b 127.0.0.1:9000 -c e:\Nginx\php5\php.ini

可以RunHiddenConsole控制CMD命令列不顯示

再寫一個stop的bat

@echo off
echo Stopping nginx...
taskkill /F /IM nginx.exe > nul
echo Stopping PHP FastCGI...
taskkill /F /IM php-cgi.exe > nul
exit

以上就介紹了Nginx + PHP Windows安裝),包括了方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.