準備工作
- 下載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