{"id":49578,"date":"2024-10-08T05:45:15","date_gmt":"2024-10-07T21:45:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/49578\/"},"modified":"2024-10-08T05:45:15","modified_gmt":"2024-10-07T21:45:15","slug":"windows-2003-iis-6-%e9%85%8d%e7%bd%ae-php-%e5%92%8c-mysql-%e6%95%b8%e6%93%9a%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/49578\/","title":{"rendered":"Windows 2003 IIS 6 \u914d\u7f6e PHP \u548c MySQL \u6578\u64da\u5eab"},"content":{"rendered":"<h1 id=\"windows-2003-iis-6-%e9%85%8d%e7%bd%ae-php-%e5%92%8c-mysql-%e6%95%b8%e6%93%9a%e5%ba%ab-sBaByuUHIK\">Windows 2003 IIS 6 \u914d\u7f6e PHP \u548c MySQL \u6578\u64da\u5eab<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u74b0\u5883\u4e2d\uff0c\u8a31\u591a\u4f01\u696d\u548c\u958b\u767c\u8005\u4ecd\u7136\u4f7f\u7528 Windows 2003 \u4f5c\u70ba\u5176\u4f3a\u670d\u5668\u64cd\u4f5c\u7cfb\u7d71\u3002\u5118\u7ba1\u9019\u500b\u7248\u672c\u7684 Windows \u5df2\u7d93\u904e\u6642\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u6cc1\u4e0b\uff0c\u4ecd\u7136\u9700\u8981\u914d\u7f6e PHP \u548c MySQL \u6578\u64da\u5eab\u4ee5\u652f\u6301\u820a\u6709\u7684\u61c9\u7528\u7a0b\u5e8f\u3002\u672c\u6587\u5c07\u8a73\u7d30\u4ecb\u7d39\u5982\u4f55\u5728 Windows 2003 \u7684 IIS 6 \u74b0\u5883\u4e2d\u914d\u7f6e PHP \u548c MySQL \u6578\u64da\u5eab\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9d-iis-6-sBaByuUHIK\">\u5b89\u88dd IIS 6<\/h2>\n<p>\u9996\u5148\uff0c\u78ba\u4fdd\u4f60\u7684 Windows 2003 \u7cfb\u7d71\u5df2\u7d93\u5b89\u88dd\u4e86 IIS 6\u3002\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<ol>\n<li>\u6253\u958b\u300c\u63a7\u5236\u9762\u677f\u300d\uff0c\u9078\u64c7\u300c\u6dfb\u52a0\u6216\u522a\u9664\u7a0b\u5e8f\u300d\u3002<\/li>\n<li>\u9ede\u64ca\u300c\u6dfb\u52a0\/\u522a\u9664 Windows \u7d44\u4ef6\u300d\u3002<\/li>\n<li>\u5728\u7d44\u4ef6\u5217\u8868\u4e2d\uff0c\u9078\u64c7\u300cInternet \u4fe1\u606f\u670d\u52d9 (IIS)\u300d\uff0c\u7136\u5f8c\u9ede\u64ca\u300c\u8a73\u7d30\u4fe1\u606f\u300d\u3002<\/li>\n<li>\u52fe\u9078\u300cWeb \u670d\u52d9\u300d\u548c\u300cFTP \u670d\u52d9\u300d\uff0c\u7136\u5f8c\u9ede\u64ca\u300c\u78ba\u5b9a\u300d\u3002<\/li>\n<li>\u5b8c\u6210\u5b89\u88dd\u5f8c\uff0c\u91cd\u555f\u4f3a\u670d\u5668\u4ee5\u61c9\u7528\u66f4\u6539\u3002<\/li>\n<\/ol>\n<h2 id=\"%e5%ae%89%e8%a3%9d-php-sBaByuUHIK\">\u5b89\u88dd PHP<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u4e0b\u8f09 PHP \u7684 Windows \u7248\u672c\u3002\u53ef\u4ee5\u5f9e PHP \u7684\u5b98\u65b9\u7db2\u7ad9\u7372\u53d6\u6700\u65b0\u7248\u672c\u7684 PHP\u3002\u4e0b\u8f09\u5f8c\uff0c\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<ol>\n<li>\u89e3\u58d3\u7e2e\u4e0b\u8f09\u7684 PHP \u6587\u4ef6\u5230\u4e00\u500b\u76ee\u9304\uff0c\u4f8b\u5982 C:PHP\u3002<\/li>\n<li>\u5c07 PHP \u7684\u76ee\u9304\u6dfb\u52a0\u5230\u7cfb\u7d71\u7684\u74b0\u5883\u8b8a\u91cf\u4e2d\u3002\u53f3\u9375\u9ede\u64ca\u300c\u6211\u7684\u96fb\u8166\u300d\uff0c\u9078\u64c7\u300c\u5c6c\u6027\u300d\uff0c\u7136\u5f8c\u5728\u300c\u9ad8\u7d1a\u300d\u9078\u9805\u5361\u4e2d\u9ede\u64ca\u300c\u74b0\u5883\u8b8a\u91cf\u300d\u3002\u5728\u300c\u7cfb\u7d71\u8b8a\u91cf\u300d\u4e2d\u627e\u5230\u300cPath\u300d\uff0c\u4e26\u5c07 C:PHP \u6dfb\u52a0\u5230\u8a72\u8b8a\u91cf\u4e2d\u3002<\/li>\n<li>\u5728 C:WindowsSystem32 \u76ee\u9304\u4e2d\u5275\u5efa php.ini \u6587\u4ef6\uff0c\u4e26\u5c07\u4ee5\u4e0b\u5167\u5bb9\u6dfb\u52a0\u5230\u8a72\u6587\u4ef6\u4e2d\uff1a<\/li>\n<\/ol>\n<pre><code>[PHP]\nextension_dir = \"C:PHPext\"\nerror_reporting = E_ALL\ndisplay_errors = On\n<\/code><\/pre>\n<p>\u63a5\u4e0b\u4f86\uff0c\u914d\u7f6e IIS \u4ee5\u652f\u6301 PHP\uff1a<\/p>\n<ol>\n<li>\u6253\u958b IIS \u7ba1\u7406\u5668\uff0c\u53f3\u9375\u9ede\u64ca\u300c\u7db2\u7ad9\u300d\uff0c\u9078\u64c7\u300c\u5c6c\u6027\u300d\u3002<\/li>\n<li>\u5728\u300c\u4e3b\u76ee\u9304\u300d\u9078\u9805\u5361\u4e2d\uff0c\u9ede\u64ca\u300c\u914d\u7f6e\u300d\u3002<\/li>\n<li>\u5728\u300c\u61c9\u7528\u7a0b\u5f0f\u914d\u7f6e\u300d\u4e2d\uff0c\u9ede\u64ca\u300c\u6dfb\u52a0\u300d\uff0c\u7136\u5f8c\u8f38\u5165\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/li>\n<\/ol>\n<pre><code>\u53ef\u57f7\u884c\u6587\u4ef6\uff1aC:PHPphp-cgi.exe\n\u64f4\u5c55\u540d\uff1a.php\n<\/code><\/pre>\n<h2 id=\"%e5%ae%89%e8%a3%9d-mysql-%e6%95%b8%e6%93%9a%e5%ba%ab-sBaByuUHIK\">\u5b89\u88dd MySQL \u6578\u64da\u5eab<\/h2>\n<p>\u63a5\u4e0b\u4f86\uff0c\u4e0b\u8f09 MySQL \u7684 Windows \u7248\u672c\u3002\u5b89\u88dd\u904e\u7a0b\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u4e0b\u8f09 MySQL \u5b89\u88dd\u5305\uff0c\u4e26\u904b\u884c\u5b89\u88dd\u7a0b\u5e8f\u3002<\/li>\n<li>\u6309\u7167\u63d0\u793a\u9032\u884c\u5b89\u88dd\uff0c\u9078\u64c7\u300c\u5178\u578b\u5b89\u88dd\u300d\u4ee5\u4fbf\u5feb\u901f\u5b89\u88dd\u3002<\/li>\n<li>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u555f\u52d5 MySQL \u670d\u52d9\uff0c\u4e26\u8a2d\u7f6e root \u7528\u6236\u7684\u5bc6\u78bc\u3002<\/li>\n<\/ol>\n<h2 id=\"%e9%85%8d%e7%bd%ae-php-%e8%88%87-mysql-%e7%9a%84%e9%80%a3%e6%8e%a5-sBaByuUHIK\">\u914d\u7f6e PHP \u8207 MySQL \u7684\u9023\u63a5<\/h2>\n<p>\u5728 PHP \u4e2d\u4f7f\u7528 MySQL \u6578\u64da\u5eab\u9700\u8981\u5b89\u88dd MySQL \u64f4\u5c55\u3002\u78ba\u4fdd\u5728 php.ini \u6587\u4ef6\u4e2d\u555f\u7528 MySQL \u64f4\u5c55\uff1a<\/p>\n<pre><code>extension=php_mysql.dll\nextension=php_mysqli.dll\n<\/code><\/pre>\n<p>\u91cd\u555f IIS \u4ee5\u4f7f\u66f4\u6539\u751f\u6548\u3002\u63a5\u4e0b\u4f86\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b PHP \u4ee3\u78bc\u6e2c\u8a66\u8207 MySQL \u7684\u9023\u63a5\uff1a<\/p>\n<pre><code>&lt;?php\n$servername = \"localhost\";\n$username = \"root\";\n$password = \"your_password\";\n$dbname = \"test_db\";\n\n\/\/ \u5275\u5efa\u9023\u63a5\n$conn = new mysqli($servername, $username, $password, $dbname);\n\n\/\/ \u6aa2\u67e5\u9023\u63a5\nif ($conn-&gt;connect_error) {\n    die(\"\u9023\u63a5\u5931\u6557: \" . $conn-&gt;connect_error);\n}\necho \"\u9023\u63a5\u6210\u529f\";\n?&gt;\n<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-sBaByuUHIK\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Windows 2003 \u7684 IIS 6 \u74b0\u5883\u4e2d\u914d\u7f6e PHP \u548c MySQL \u6578\u64da\u5eab\u96d6\u7136\u9700\u8981\u4e00\u4e9b\u6b65\u9a5f\uff0c\u4f46\u53ea\u8981\u6309\u7167\u4e0a\u8ff0\u6307\u5c0e\u9032\u884c\uff0c\u5c31\u80fd\u5920\u6210\u529f\u642d\u5efa\u4e00\u500b\u904b\u884c PHP \u61c9\u7528\u7a0b\u5e8f\u7684\u74b0\u5883\u3002\u5c0d\u65bc\u9700\u8981\u4f7f\u7528\u820a\u7248\u7cfb\u7d71\u7684\u958b\u767c\u8005\u4f86\u8aaa\uff0c\u9019\u662f\u4e00\u500b\u91cd\u8981\u7684\u6280\u80fd\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0cServer.HK \u63d0\u4f9b\u591a\u7a2e\u9078\u64c7\u4ee5\u6eff\u8db3\u60a8\u7684\u9700\u6c42\u3002\u7121\u8ad6\u662f\u642d\u5efa\u7db2\u7ad9\u9084\u662f\u904b\u884c\u61c9\u7528\u7a0b\u5e8f\uff0c\u6211\u5011\u7684 <a href=\"https:\/\/server.hk\">\u4f3a\u670d\u5668<\/a> \u90fd\u80fd\u70ba\u60a8\u63d0\u4f9b\u7a69\u5b9a\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to configure PHP and MySQL on Windows 2003 IIS 6 for optimal web application performance and seamless database integration.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-49578","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=49578"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49578\/revisions"}],"predecessor-version":[{"id":49579,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/49578\/revisions\/49579"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=49578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=49578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=49578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}