{"id":241,"date":"2023-10-14T18:36:44","date_gmt":"2023-10-14T10:36:44","guid":{"rendered":"https:\/\/miie.net\/?p=241"},"modified":"2023-10-14T18:36:44","modified_gmt":"2023-10-14T10:36:44","slug":"install-wordpress-with-iis-and-php","status":"publish","type":"post","link":"https:\/\/diji.net\/?p=241","title":{"rendered":"\u5728IIS\u4e2d\u90e8\u7f72WordPress"},"content":{"rendered":"<h1>\u5728IIS\u4e2d\u90e8\u7f72Wordpress<\/h1>\n<h2>1.\u51c6\u5907\u5de5\u4f5c<\/h2>\n<p>1.Windows\u7cfb\u7edf<br \/>\n2.PHP\u7a0b\u5e8f<br \/>\n\u4e0b\u8f7d\u7f51\u5740\uff1a<br \/>\n<a href=\"https:\/\/windows.php.net\/download\/\"><a href=\"https:\/\/windows.php.net\/download\/\"><a href=\"https:\/\/windows.php.net\/download\/\"><a href=\"https:\/\/windows.php.net\/download\/\">https:\/\/windows.php.net\/download\/<\/a><\/a><\/a><\/a><br \/>\n\u6216\u8005<br \/>\n<a href=\"https:\/\/windows.php.net\/downloads\/releases\/php-8.2.11-nts-Win32-vs16-x64.zip\"><a href=\"https:\/\/windows.php.net\/downloads\/releases\/php-8.2.11-nts-Win32-vs16-x64.zip\"><a href=\"https:\/\/windows.php.net\/downloads\/releases\/php-8.2.11-nts-Win32-vs16-x64.zip\"><a href=\"https:\/\/windows.php.net\/downloads\/releases\/php-8.2.11-nts-Win32-vs16-x64.zip\">https:\/\/windows.php.net\/downloads\/releases\/php-8.2.11-nts-Win32-vs16-x64.zip<\/a><\/a><\/a><\/a><\/p>\n<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/01.png\" alt=\"Alt text\" \/><\/p>\n<h2>2.\u914d\u7f6ePHP<\/h2>\n<p>\u89e3\u538b\u4e0b\u8f7d\u7684PHP\u538b\u7f29\u5305\uff0c\u627e\u5230php.ini-development\u6587\u4ef6\uff0c\u590d\u5236\u4e00\u4efd\uff0c\u91cd\u547d\u540d\u4e3aphp.ini\u3002<br \/>\n\u4fee\u6539\u8be5php.ini\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\n;\u653e\u7f6ePHP\u6269\u5c55\u7684\u76ee\u5f55\uff0c\u53bb\u6389\u4e0b\u9762\u524d\u9762\u7684\u6ce8\u91ca\uff0c\u542f\u7528\u6269\u5c55\u529f\u80fd\nextension_dir = &quot;ext&quot;\n\n;\u542f\u7528\u6269\u5c55\u3002\u4e0d\u9700\u8981\u4e00\u4e2a\u4e00\u4e2a\u7684\u627e\uff0c\u8fd9\u4e00\u5757\u7684\u6269\u5c55\u5168\u90e8\u542f\u7528\u90fd\u53ef\u4ee5\u3002\nextension=bz2\nextension=ldap\nextension=curl\nextension=ffi\nextension=ftp\nextension=fileinfo\nextension=gd\nextension=gettext\nextension=gmp\nextension=intl\nextension=imap\nextension=mbstring\nextension=exif      ; Must be after mbstring as it depends on it\nextension=mysqli\nextension=odbc\nextension=openssl\nextension=pdo_firebird\nextension=pdo_mysql\nextension=pdo_oci\nextension=pdo_odbc\nextension=pdo_pgsql\nextension=pdo_sqlite\nextension=pgsql\nextension=shmop\nextension=soap\nextension=sockets\nextension=sqlite3\nextension=tidy\nextension=xsl\nextension=zip\n\n;\u542f\u7528\u5e76\u4fee\u6539session\u6587\u4ef6\u7684\u5b58\u50a8\u76ee\u5f55\u3002\nsession.save_path = &quot;C:\\tmp&quot;\n\n;\u4fee\u6539PHP\u4e0a\u4f20\u6700\u5927\u9650\u5236\npost_max_size = 200M\nupload_max_filesize = 200M\n\n<\/pre>\n<\/p>\n<p>\u4fee\u6539\u5b8c\u4fdd\u5b58\u4e00\u4e0b\u3002\u8bbe\u7f6e\u4e00\u4e0bC:\\tmp\u7684\u6587\u4ef6\u5939\u6743\u9650\u3002\u6dfb\u52a0IIS_IUSRS\u7528\u6237\uff0c\u8bbe\u7f6e\u6240\u6709\u6743\u9650\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/02.png\" alt=\"Alt text\" \/><\/p>\n<h2>3.\u5b89\u88c5IIS<\/h2>\n<h3>\u5b89\u88c5IIS<\/h3>\n<p>\u6253\u5f00Windows 11 \u7684\u5e94\u7528\u754c\u9762-&gt;\u53ef\u9009\u529f\u80fd-&gt;\u66f4\u591aWindows\u529f\u80fd\u3002\u8fdb\u5165\u542f\u7528\u6216\u5173\u95edWindows\u529f\u80fd\u754c\u9762\u3002<br \/>\n\u5c55\u5f00Internet Information Services\uff0c\u52fe\u9009Web\u7ba1\u7406\u5de5\u5177\u4e2d\u7684IIS\u7ba1\u7406\u63a7\u5236\u53f0\u548c\u4e07\u7ef4\u7f51\u670d\u52a1\u4e2d\u7684CGI\u3001ASP.NET\uff0c\u8fd8\u6709\u5e38\u89c1HTTP\u529f\u80fd\u4e2d\u7684\u9759\u6001\u5185\u5bb9\u3001\u9ed8\u8ba4\u6587\u6863\u3001\u76ee\u5f55\u6d4f\u89c8\uff0c\u7136\u540e\u70b9\u51fb\u786e\u5b9a\u3002<br \/>\n\u5982\u679c\u4e0d\u52fe\u9009ASP.NET\uff0cIIS\u7ba1\u7406\u5668\u91cc\u9762\u6ca1\u6709\u9ed8\u8ba4\u6587\u6863\u8bbe\u7f6e\u3002<br \/>\n\u5982\u679c\u4e0d\u52fe\u9009\u9759\u6001\u5185\u5bb9\uff0cIIS\u7ba1\u7406\u5668\u91cc\u9762\u6ca1\u6709MIME\u7c7b\u578b\u8bbe\u7f6e\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/03.png\" alt=\"Alt text\" \/><\/p>\n<p>\u7a0d\u7b49\u7247\u523b\uff0c\u5b89\u88c5\u5b8c\u540e\u3002\u6253\u5f00IIS\u7ba1\u7406\u5668\u3002\u5728Windows 11\u5f00\u59cb\u83dc\u5355\u4e0a\u641c\u7d22IIS\uff0c\u6253\u5f00\u5373\u53ef\u3002\u6700\u597d\u628aIIS\u7ba1\u7406\u5668\u56fa\u5b9a\u5728\u5f00\u59cb\u83dc\u5355\uff0c\u65b9\u4fbf\u4e0b\u6b21\u4f7f\u7528\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/04.png\" alt=\"Alt text\" \/><\/p>\n<h3>\u914d\u7f6ePHP<\/h3>\n<p>\u6253\u5f00IIS\u7ba1\u7406\u5668,\u627e\u5230\u5904\u7406\u7a0b\u5e8f\u6620\u5c04\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/05.png\" alt=\"Alt text\" \/><\/p>\n<p>\u6253\u5f00\u5904\u7406\u7a0b\u5e8f\u6620\u5c04\u754c\u9762\uff0c\u70b9\u51fb\u6709\u53f3\u8fb9\u7684\u6dfb\u52a0\u6a21\u5757\u6620\u5c04\u3002\u6dfb\u52a0PHP\u76f8\u5173\u4fe1\u606f\uff0c\u7136\u540e\u70b9\u51fb\u786e\u5b9a\u3002\u5982\u4e0b\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/06.png\" alt=\"Alt text\" \/><\/p>\n<p>\u5982\u679c\u63d0\u793a\uff1a\u8981\u4e3a\u6b64\u53ef\u6267\u884c\u6587\u4ef6\u521b\u5efaFastCGI\u5e94\u7528\u7a0b\u5e8f\u5417\uff1f\u70b9\u51fb\u201c\u662f\u201d\u5c06\u6b64\u9879\u6dfb\u52a0\u5230FastCGI\u96c6\u5408\u4e2d\uff0c\u4ee5\u53ca\u5141\u8bb8\u6b64\u53ef\u6267\u884c\u6587\u4ef6\u4f5c\u4e3aFastCGI\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u3002<br \/>\n\u70b9\u51fb\u662f\u5373\u53ef\u3002<\/p>\n<h3>\u6dfb\u52a0\u9ed8\u8ba4\u6587\u6863<\/h3>\n<p>\u9ed8\u8ba4\u6587\u6863\u5373index.html\u3001index.htm\u3001default.htm\u3002\u8fd9\u91cc\u6211\u4eec\u8981\u4f7f\u7528PHP\uff0c\u5c31\u8981\u628aidnex.php\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u6587\u6863\u3002<br \/>\n\u627e\u5230\u9ed8\u8ba4\u6587\u6863\u8bbe\u7f6e\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/07.png\" alt=\"Alt text\" \/><\/p>\n<p>\u6dfb\u52a0index.php\u4e3a\u9ed8\u8ba4\u6587\u6863\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/08.png\" alt=\"Alt text\" \/><\/p>\n<h3>\u6dfb\u52a0MIME\u7c7b\u578b<\/h3>\n<p>\u8fd9\u91cc\u7684\u64cd\u4f5c\u4e3b\u8981\u662f\u4e00\u4e9b\u6587\u4ef6\u5982CSS\u3001JS\u3001ISO\u7b49\u5728IIS\u4e2d\u9ed8\u8ba4\u4e0d\u4e0b\u8f7d\u3002\u4f1a\u63d0\u793a\u9519\u8bef\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/09.png\" alt=\"Alt text\" \/><\/p>\n<p>\u6dfb\u52a0\u6587\u4ef6\u6269\u5c55\u540d\u4e3a\u661f\u53f7(*),MIME\u7c7b\u578b\u4e3aapplication\/octet-stream\u3002\u8868\u793a\u6240\u6709\u6587\u4ef6\u7686\u53ef\u4e0b\u8f7d\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/10.png\" alt=\"Alt text\" \/><\/p>\n<h2>4.\u5b89\u88c5Wordpress<\/h2>\n<p>\u6ce8\uff1aWordpress\u9700\u8981\u6570\u636e\u5e93\u652f\u6301\uff0c\u9ed8\u8ba4\u94fe\u63a5\u6570\u636e\u5e93\u662fMySQL\u6216MariaDB\u3002\u8fd9\u91cc\u4f7f\u7528\u7684\u662fSQLite\uff0c\u5177\u4f53\u4f7f\u7528SQLite\u64cd\u4f5c\u65b9\u6cd5\u8bf7\u67e5\u9605\u4e0a\u4e00\u7bc7\u3002<\/p>\n<p>\u5c06\u4e0b\u8f7d\u4e0b\u6765\u7684Wordpress\u538b\u7f29\u5305\u653e\u5728\u7f51\u7ad9\u76ee\u5f55\u91cc\u3002\u53ef\u4ee5\u653e\u5728\u9ed8\u8ba4\u7f51\u7ad9C:\\inetpub\\wwwroot\uff0c\u4e5f\u53ef\u4ee5\u65b0\u5efa\u7684\u7f51\u7ad9\u76ee\u5f55\u91cc\u9762\u3002<\/p>\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00http:\/\/localhost\/wordpress\uff0c\u53ef\u4ee5\u5373\u53ef\u5b89\u88c5Wordpress\u3002<\/p>\n<p>\u6ce8\u610f\uff1a<br \/>\n\u8fd8\u9700\u8981\u7ed9\u7f51\u7ad9\u76ee\u5f55\u8bbe\u7f6eIIS_IUSRS\u6743\u9650\uff0c\u5426\u5219Wordpress\u65e0\u6cd5\u5b89\u88c5\u63d2\u4ef6\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/11.png\" alt=\"Alt text\" \/><\/p>\n<h2>5.Wordpress\u4f2a\u9759\u6001<\/h2>\n<p>\u5230\u5fae\u8f6f\u7f51\u7ad9\u4e0b\u8f7dURL\u91cd\u5199\u6a21\u5757\uff08URL Rewrite\uff09\u3002<br \/>\n<a href=\"https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite\"><a href=\"https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite\"><a href=\"https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite\">https:\/\/www.iis.net\/downloads\/microsoft\/url-rewrite<\/a><\/a><\/a><\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/12.png\" alt=\"Alt text\" \/><\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\u3002<br \/>\n\u5c06\u4ee5\u4e0b\u5185\u5bb9\u4fdd\u5b58\u4e3aweb.config\u6587\u4ef6\uff0c\u653e\u5728wordpress\u8ddf\u76ee\u5f55\u4e2d\u3002<br \/>\n\u5982\u679c\u7f51\u7ad9\u6839\u76ee\u5f55\u5c31\u662fWordpress\u7684\u6839\u76ee\u5f55\uff0c\u90a3\u5c31\u653e\u7f6e\u518d\u7f51\u7ad9\u6839\u76ee\u5f55\u3002<br \/>\n\u4e00\u5b9a\u8981\u5148\u5b89\u88c5\u7136\u540e\u518d\u5b58\u653eweb.config\u6587\u4ef6\u3002<\/p>\n<p><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;configuration&gt;\n  &lt;system.webServer&gt;\n    &lt;rewrite&gt;\n      &lt;rules&gt;\n                &lt;rule name=&quot;category&quot;&gt;\n                    &lt;match url=&quot;category\/?(.*)&quot; \/&gt;\n                    &lt;conditions logicalGrouping=&quot;MatchAll&quot; trackAllCaptures=&quot;false&quot; \/&gt;\n                    &lt;action type=&quot;Rewrite&quot; url=&quot;\/index.php?category_name={R:1}&quot; appendQueryString=&quot;false&quot; logRewrittenUrl=&quot;false&quot; \/&gt;\n                &lt;\/rule&gt;\n                &lt;rule name=&quot;tags&quot;&gt;\n                    &lt;match url=&quot;tag\/?(.*)&quot; \/&gt;\n                    &lt;conditions logicalGrouping=&quot;MatchAll&quot; trackAllCaptures=&quot;false&quot; \/&gt;\n                    &lt;action type=&quot;Rewrite&quot; url=&quot;index.php?tag={R:1}&quot; \/&gt;\n                &lt;\/rule&gt;\n                &lt;rule name=&quot;Main Rule&quot; stopProcessing=&quot;true&quot;&gt;\n                    &lt;match url=&quot;.*&quot; \/&gt;\n                    &lt;conditions logicalGrouping=&quot;MatchAll&quot; trackAllCaptures=&quot;false&quot;&gt;\n                        &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsFile&quot; negate=&quot;true&quot; \/&gt;\n                        &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsDirectory&quot; negate=&quot;true&quot; \/&gt;\n                    &lt;\/conditions&gt;\n                    &lt;action type=&quot;Rewrite&quot; url=&quot;index.php\/{R:0}&quot; \/&gt;\n                &lt;\/rule&gt;\n                &lt;rule name=&quot;wordpress&quot; patternSyntax=&quot;Wildcard&quot;&gt;\n                    &lt;match url=&quot;*&quot; \/&gt;\n                    &lt;conditions logicalGrouping=&quot;MatchAll&quot; trackAllCaptures=&quot;false&quot;&gt;\n                        &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsFile&quot; negate=&quot;true&quot; \/&gt;\n                        &lt;add input=&quot;{REQUEST_FILENAME}&quot; matchType=&quot;IsDirectory&quot; negate=&quot;true&quot; \/&gt;\n                    &lt;\/conditions&gt;\n                    &lt;action type=&quot;Rewrite&quot; url=&quot;index.php&quot; \/&gt;\n                &lt;\/rule&gt;&lt;\/rules&gt;\n    &lt;\/rewrite&gt;\n  &lt;\/system.webServer&gt;\n&lt;\/configuration&gt;\n<\/pre>\n<\/p>\n<p>\u5b8c\u6210\u540e\uff0c\u5c31\u53ef\u4ee5\u8bbe\u7f6eWordpress\u7684\u4f2a\u9759\u6001\u94fe\u63a5\u4e86\u3002<\/p>\n<p><img decoding=\"async\" src=\"\/img\/20231014-install-wordpress-with-iis-php\/13.png\" alt=\"Alt text\" \/><\/p>\n<p>\u7ed3\u675f\uff0c\u6109\u5feb\u7684\u73a9\u800d\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728IIS\u4e2d\u90e8\u7f72Wordpress 1.\u51c6\u5907\u5de5\u4f5c 1.Windows\u7cfb\u7edf 2.PHP\u7a0b\u5e8f \u4e0b\u8f7d\u7f51\u5740\uff1a https:\/\/windows.php.net\/download\/ \u6216\u8005 https:\/\/windows.php.net\/downloads\/releases\/php-8.2.11-nts-Win32-vs16-x64.zip 2.\u914d\u7f6ePHP \u89e3\u538b\u4e0b\u8f7d\u7684PHP\u538b\u7f29\u5305\uff0c\u627e\u5230php.ini-development\u6587\u4ef6\uff0c\u590d\u5236\u4e00\u4efd\uff0c\u91cd\u547d\u540d\u4e3aphp.ini\u3002 \u4fee\u6539\u8be5php.ini\u914d\u7f6e\u6587\u4ef6\u3002 ;\u653e\u7f6ePHP\u6269\u5c55\u7684\u76ee\u5f55\uff0c\u53bb\u6389\u4e0b\u9762\u524d\u9762\u7684\u6ce8\u91ca\uff0c\u542f\u7528\u6269\u5c55\u529f\u80fd extension_dir = &quot;ext&quot; ;\u542f\u7528\u6269\u5c55\u3002\u4e0d\u9700\u8981\u4e00\u4e2a\u4e00\u4e2a\u7684\u627e\uff0c\u8fd9\u4e00\u5757\u7684\u6269\u5c55\u5168\u90e8\u542f\u7528\u90fd\u53ef\u4ee5\u3002 extension=bz2 extension=ldap extension=curl extension=ffi extension=ftp extension=fileinfo extension=gd extension=gettext extension=gmp extension=intl extension=imap extension=mbstring extension=exif ; Must be after mbstring as it depends on it extension=mysqli extension=odbc extension=openssl extension=pdo_firebird extension=pdo_mysql extension=pdo_oci extension=pdo_odbc extension=pdo_pgsql extension=pdo_sqlite extension=pgsql extension=shmop extension=soap extension=sockets extension=sqlite3 extension=tidy extension=xsl [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,16],"tags":[],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-php","category-wordpress"],"_links":{"self":[{"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/diji.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=241"}],"version-history":[{"count":0,"href":"https:\/\/diji.net\/index.php?rest_route=\/wp\/v2\/posts\/241\/revisions"}],"wp:attachment":[{"href":"https:\/\/diji.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/diji.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/diji.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}