The company asked for a wiki to write the interface document, so try to build a bit, failed many times, finally finally done.
First, the test environment
1. Operating system: Windows7
2, Nginx:nginx-1.6.3.zip
3, Php:php-5.5.25-nts-win32-vc11-x64.zip
4, wiki:mediawiki-1.24.2.tar.gz
Second, the configuration Nginx
Unzip Nginx-1.6.3.zip to D:\web and rename the folder nginx-1.6.3 to nginx_80.
Modify D:\web\nginx_80\conf\nginx.conf to be configured as follows
Worker_processes 1;events { worker_connections 1024;} HTTP { include mime.types; Default_type Application/octet-stream; Sendfile on ; Keepalive_timeout ; server {Listen 80;server_name localhost;root "D:/web/www/wiki"; index index.html index.htm index.php;location/{index in dex.php; Error_page 404 = @mediawiki;} Location @mediawiki {rewrite ^/wiki ([^?] *)(?:\? (.*))? /index.php?title=$1&$2 last;} Location ~ \.php?$ {include d:/web/nginx_80/conf/fastcgi_params;fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php; Include Fastcgi.conf;}}}
Modify D:\web\nginx_80\conf\fastcgi.conf, add at the end
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Third, configure PHP
Unzip Php-5.5.25-nts-win32-vc11-x64.zip to D:\web and rename the extracted folder php-5.5.25-nts-win32-vc11-x64 to PHP5.
Rename D:\web\php5\php.ini-production to PHP.ini,
Find Short_open_tag = Off
Modified to Short_open_tag = On
and add the following configuration at the end of the php.ini.
Extension_dir = "D:\web\php5\ext" extension=php_curl.dllextension=php_gd2.dllextension=php_mbstring.dllextension= Php_mysql.dllextension=php_mysqli.dllextension=php_pdo_mysql.dllextension=php_pdo_sqlite.dllextension=php_ Sockets.dllextension=php_sqlite3.dllextension=php_exif.dlldate.timezone = asia/chongqing
Iv. Configuration MediaWiki
Unzip mediawiki-1.24.2.tar.gz to D:\web\www and rename the extracted folder mediawiki-1.24.2 to wiki.
Go to command line execution
D:\web\nginx_80>nginx.exe
If you modify the nginx.conf configuration, execute the following command to reload Nginx so that the configuration takes effect.
D:\web\nginx_80>nginx.exe-s Reload
Open a new command-line window and execute the following command to start php5-cgi.
D:\web\php5>php-cgi.exe-b 127.0.0.1:9000-c D:\web\php5\php.ini
Enter the browser input localhost will enter the MediaWiki installation interface, follow the steps to install, after the installation is completed will generate a localsettings.php, in the tail of localsettings.php add the following configuration.
$wgScriptPath = ""; $wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true;
Put the localsettings.php into the D:\web\www\wiki.
Re-enter http://localhost and see the wiki homepage.
The above describes the Nginx+php5+mediawiki configuration, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.