http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip
2.下載PHP
http://windows.php.net/downloads/releases/php-5.6.9-Win32-VC11-x64.zip
把里面文件的php.ini-development 更名為php.ini
Uncomment下列語句
?extension_dir = "ext"
可以用命令檢測是否能用php -v
如果報錯php.exe is not a valid win32 application,那就是這個php是32位版本,而OS是64位
3.將里面的upload文件放在IIS下,convert to application,選擇Framework v4版本的application pool
雙擊“處理程序映射”,“添加模塊映射”,把php-cgi.exe加進去
做一個test.php文件,里面的內容是<?php phpinfo(); ?>,然后在瀏覽器里打localhost/..../text.php
這樣可以測試是否可以顯示php頁面
之后瀏覽網頁提示不允許目錄瀏覽,點擊Default Web Site->目錄瀏覽->啟用
然后瀏覽網頁提示FastCGI進程意外退出
進入PHP目錄,運行PHP -v , 提示找不到msvcr110.dll64
嘗試下載位版本的dll,但放進C:\Windows\windows/system32或者C:\Windows\SysWOW64依然會報錯,后來下載vcredist_x64,安裝好后就可以了
計算機中丟失 msvcr110.dll 怎么辦
http://jingyan.baidu.com/article/4f7d57129fa86e1a201927de.html
Visual C++ Redistributable for Visual Studio 2012 Update 4
http://www.microsoft.com/zh-cn/download/confirmation.aspx?id=30679

4進入安裝界面后,會提示一系列目錄不存在以及mysql不支持
對于列出的目錄,全部加上IUSR和IIS_IUSRS用戶,并且給予他們全部權限。注意不起作用的話,關掉選項卡,再次嘗試刷新。
http://dlsw.baidu.com/sw-search-sp/gaosu/2015_03_23_16/bind1/12585/mysql_installer_community_V5.6.21.1_setup_12585_BDdl.exe
得到的是綠色安裝版本,按下面鏈接改my.ini,之后運行mysqld -install 就會安裝了
注意如果安裝成功后報錯連接不了端口,這是因為有個mysql的服務沒有啟動,啟動了就可以telnet上了
http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.22-winx64.zip
MySQL綠色版的安裝(mysql-5.6.22-win32.zip)
http://www.cnblogs.com/freeton/p/4264829.html

6.回到安裝界面,會發現還是說不支持mysql
此時應當檢查php.ini里面的驅動有沒有uncomment掉
extension=php_mysql.dll
extension=php_mysqli.dll
如果還是不行,則重啟IIS服務器,應該是OK的了
7.IIS6下運行Discuz,忽略那些php5iapi.dll,要用fastcgi方法
WIN2003+IIS6+FastCGI+PHP5.4.30的安裝配置
http://hanbaohong.iteye.com/blog/1273205
Microsoft IIS 5.1 and IIS 6.0 Configuring IIS to process PHP requests
http://www.php.net/manual/en/install.windows.iis6.php
a.首先是安裝fcgisetup_1.5_rtw_x64.msi
安裝后會在C:\WINDOWS\system32\inetsrv\目錄下多出了5個文件fcgiconfig.js,fcgiext.dll,fcgiext.ini,fcgilicense.rtf,fcgireadme.htm
這個時候在IIS6的"WEB服務擴展"里就多出了一個FastCGI Handler , 設為允許
b.CGI and FastCGI settings in php.ini
fastcgi.impersonate = 1 fastcgi.logging = 0 cgi.fix_pathinfo=1 cgi.force_redirect = 0
c.Configuring FastCGI extension to handle PHP requests
cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" ^ -extension:php -path:"C:\PHP\php-cgi.exe"
d.Application -> Properties -> Configuration->Add
可執行文件填寫C:\WINDOWS\system32\inetsrv\fcgiext.dll
擴展名填寫.php。
動作->限制為GET,HEAD,POST。
Documents -> Add index.php
e.測試
用文本寫一段測試代碼:
<?php
phpinfo();
?>
保存為index.php,名字隨便取,只要后綴是.php就可以。把index.php放到根目錄下,我這里是C:\Inetpub\wwwroot,然后在瀏覽器中輸入http://localhost/index.php就可以得到返回的信息了。
?
8.DX3.2 、PHP7出錯set_magic_quotes_runtime()
http://localhost/discuz/install/
The website cannot display the page |
? |
PHP Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in D:\Inetpub\wwwroot\discuz\install\index.php:12
Stack trace:
#0 {main}
thrown in D:\Inetpub\wwwroot\discuz\install\index.php on line 12
從PHP 5.4開始,set_magic_quotes_runtime()已經被棄用,從PHP 7.0開始set_magic_quotes_runtime()已經被移除
對于 Discuz! X3.2,即刪除install/index.php的以下代碼
@set_magic_quotes_runtime(0);
?9.DX3.2 、PHP7出錯Call to undefined function mysql_escape_string()
PHP Debug
No. | File | Line | Code |
1 | index.php | 130 | require(%s) |
2 | forum.php | 56 | discuz_application->init() |
3 | source/class/discuz/discuz_application.php | 66 | discuz_application->_init_setting() |
4 | source/class/discuz/discuz_application.php | 686 | loadcache(Array) |
5 | source/function/function_core.php | 702 | table_common_syscache->fetch_all(Array) |
6 | source/class/table/table_common_syscache.php | 63 | discuz_database::field(%s, Array) |
7 | source/class/discuz/discuz_database.php | 271 | discuz_database::quote(Array) |
8 | source/class/discuz/discuz_database.php | 185 | discuz_database::quote(%s, true) |
9 | source/class/discuz/discuz_database.php | 177 | break() |
好吧,那就換成php5.6,結果更離奇了,打開后什么都沒有,也沒有錯誤消息。
最后,幸好有人實現了Discuz3.2對PHP7的兼容,直接下載就好了
X3.2針對PHP7的兼容版本-測試ing
http://www.discuz.net/thread-3699198-1-1.html
https://github.com/branchzero/discuz-x32-php7/releases
注意,如果PHPAdmin用IE8或者IE8以下的瀏覽器,版面會亂掉。不要緊,換個瀏覽器就行了。