Windows2012+PHP7+NGINX1.9 搭建PHP環境____PHP

來源:互聯網
上載者:User

準備工作

下載php:http://www.php.net/downloads.php 下載php相關:vc_redist.x64 (不下載這個的話,啟動會報找不到dll),十幾M不大

修改php配置

找到php.ini-development檔案,修改為php.ini,儲存後開啟: 找到extension_dir去掉注釋,並把後邊的路徑改為ext檔案的實際路徑,如c:/php7/ext 找到extension=php_mysqli.dll去掉注釋

啟動php

php-cgi.ext -b 127.0.0.1:9000

配置nginx

location / {root           C:\Web\bbs;index  index.html index.htm index.php;}#訪問前台        location ~ \.php$ {            #rewrite ^/archiver/((fid|tid)-[\w\-]+\.html)$ /archiver/index.php?$1 last;            #rewrite ^/forum-([0-9]+)-([0-9]+)\.html$ /forumdisplay.php?fid=$1&page=$2 last;            #rewrite ^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /viewthread.php?tid=$1&extra=page%3D$3&page=$2 last;            #rewrite ^/space-(username|uid)-(.+)\.html$ /space.php?$1=$2 last;            #rewrite ^/tag-(.+)\.html$ /tag.php?name=$1 last;    root           C:\Web\bbs;    fastcgi_pass   127.0.0.1:9000;    fastcgi_index  index.php;    fastcgi_param  SCRIPT_FILENAME  C:\Web\bbs$fastcgi_script_name;    include        fastcgi_params;}

php終端的解決方式:http://www.zuimoban.com/php/php/11504.html



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.