{"id":96458,"date":"2024-10-20T09:37:19","date_gmt":"2024-10-20T01:37:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/96458\/"},"modified":"2024-10-20T09:37:19","modified_gmt":"2024-10-20T01:37:19","slug":"phpstudy%e8%bc%95%e9%ac%86%e6%90%ad%e5%bb%ba%e5%8b%95%e6%85%8b%e6%95%b8%e6%93%9a%e5%ba%ab%e7%92%b0%e5%a2%83-phpstudy%e5%8b%95%e6%85%8b%e6%95%b8%e6%93%9a%e5%ba%ab","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/96458\/","title":{"rendered":"PHPStudy\u8f15\u9b06\u642d\u5efa\u52d5\u614b\u6578\u64da\u5eab\u74b0\u5883 (phpstudy\u52d5\u614b\u6578\u64da\u5eab)"},"content":{"rendered":"<h1 id=\"phpstudy%e8%bc%95%e9%ac%86%e6%90%ad%e5%bb%ba%e5%8b%95%e6%85%8b%e6%95%b8%e6%93%9a%e5%ba%ab%e7%92%b0%e5%a2%83-PqULEnQEXp\">PHPStudy\u8f15\u9b06\u642d\u5efa\u52d5\u614b\u6578\u64da\u5eab\u74b0\u5883<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u7db2\u7d61\u958b\u767c\u4e2d\uff0cPHP\u4f5c\u70ba\u4e00\u7a2e\u6d41\u884c\u7684\u4f3a\u670d\u5668\u7aef\u8173\u672c\u8a9e\u8a00\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u52d5\u614b\u7db2\u7ad9\u548c\u61c9\u7528\u7a0b\u5e8f\u7684\u958b\u767c\u3002\u70ba\u4e86\u65b9\u4fbf\u958b\u767c\u8005\u9032\u884c\u672c\u5730\u6e2c\u8a66\u548c\u958b\u767c\uff0cPHPStudy\u4f5c\u70ba\u4e00\u6b3e\u96c6\u6210\u74b0\u5883\uff0c\u63d0\u4f9b\u4e86\u4e00\u500b\u7c21\u55ae\u6613\u7528\u7684\u89e3\u6c7a\u65b9\u6848\u4f86\u642d\u5efa\u52d5\u614b\u6578\u64da\u5eab\u74b0\u5883\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528PHPStudy\u8f15\u9b06\u642d\u5efa\u52d5\u614b\u6578\u64da\u5eab\u74b0\u5883\uff0c\u4e26\u63d0\u4f9b\u4e00\u4e9b\u5be6\u7528\u7684\u793a\u4f8b\u548c\u4ee3\u78bc\u7247\u6bb5\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%afphpstudy%ef%bc%9f-PqULEnQEXp\">\u4ec0\u9ebc\u662fPHPStudy\uff1f<\/h2>\n<p>PHPStudy\u662f\u4e00\u6b3e\u96c6\u6210\u4e86Apache\u3001PHP\u548cMySQL\u7684\u672c\u5730\u958b\u767c\u74b0\u5883\uff0c\u65e8\u5728\u5e6b\u52a9\u958b\u767c\u8005\u5feb\u901f\u642d\u5efa\u548c\u6e2c\u8a66PHP\u61c9\u7528\u3002\u5b83\u7684\u754c\u9762\u53cb\u597d\uff0c\u5b89\u88dd\u7c21\u55ae\uff0c\u9069\u5408\u5404\u7a2e\u6c34\u5e73\u7684\u958b\u767c\u8005\u4f7f\u7528\u3002\u7121\u8ad6\u662f\u521d\u5b78\u8005\u9084\u662f\u5c08\u696d\u958b\u767c\u8005\uff0c\u90fd\u80fd\u5920\u8f15\u9b06\u4e0a\u624b\u3002<\/p>\n<h2 id=\"%e5%ae%89%e8%a3%9dphpstudy-PqULEnQEXp\">\u5b89\u88ddPHPStudy<\/h2>\n<p>\u5b89\u88ddPHPStudy\u7684\u904e\u7a0b\u975e\u5e38\u7c21\u55ae\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u8a2a\u554fPHPStudy\u7684\u5b98\u65b9\u7db2\u7ad9\uff0c\u4e0b\u8f09\u6700\u65b0\u7248\u672c\u7684\u5b89\u88dd\u5305\u3002<\/li>\n<li>\u89e3\u58d3\u7e2e\u4e0b\u8f09\u7684\u6587\u4ef6\uff0c\u7136\u5f8c\u96d9\u64ca\u904b\u884c\u5b89\u88dd\u7a0b\u5e8f\u3002<\/li>\n<li>\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88dd\uff0c\u9078\u64c7\u5b89\u88dd\u8def\u5f91\u548c\u5176\u4ed6\u8a2d\u7f6e\u3002<\/li>\n<li>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u555f\u52d5PHPStudy\u3002<\/li>\n<\/ol>\n<h2 id=\"%e9%85%8d%e7%bd%aephpstudy-PqULEnQEXp\">\u914d\u7f6ePHPStudy<\/h2>\n<p>\u555f\u52d5PHPStudy\u5f8c\uff0c\u60a8\u5c07\u770b\u5230\u4e00\u500b\u7c21\u55ae\u7684\u754c\u9762\u3002\u5728\u9019\u88e1\uff0c\u60a8\u53ef\u4ee5\u9032\u884c\u4ee5\u4e0b\u914d\u7f6e\uff1a<\/p>\n<ul>\n<li><strong>\u555f\u52d5\u670d\u52d9\uff1a<\/strong>\u9ede\u64ca\u201c\u555f\u52d5\u201d\u6309\u9215\uff0c\u555f\u52d5Apache\u548cMySQL\u670d\u52d9\u3002<\/li>\n<li><strong>\u8a2d\u7f6e\u865b\u64ec\u4e3b\u6a5f\uff1a<\/strong>\u5728\u201c\u865b\u64ec\u4e3b\u6a5f\u201d\u9078\u9805\u4e2d\uff0c\u60a8\u53ef\u4ee5\u6dfb\u52a0\u65b0\u7684\u865b\u64ec\u4e3b\u6a5f\uff0c\u65b9\u4fbf\u7ba1\u7406\u591a\u500b\u9805\u76ee\u3002<\/li>\n<li><strong>\u4fee\u6539PHP\u914d\u7f6e\uff1a<\/strong>\u5728\u201cPHP\u8a2d\u7f6e\u201d\u4e2d\uff0c\u60a8\u53ef\u4ee5\u6839\u64da\u9700\u8981\u4fee\u6539PHP\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4f8b\u5982\u958b\u555f\u6216\u95dc\u9589\u64f4\u5c55\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%89%b5%e5%bb%ba%e6%95%b8%e6%93%9a%e5%ba%ab-PqULEnQEXp\">\u5275\u5efa\u6578\u64da\u5eab<\/h2>\n<p>\u5728PHPStudy\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528phpMyAdmin\u4f86\u7ba1\u7406\u6578\u64da\u5eab\u3002\u4ee5\u4e0b\u662f\u5275\u5efa\u6578\u64da\u5eab\u7684\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u5728\u700f\u89bd\u5668\u4e2d\u8f38\u5165 <code>http:\/\/localhost\/phpmyadmin<\/code> \u9032\u5165phpMyAdmin\u754c\u9762\u3002<\/li>\n<li>\u4f7f\u7528\u9ed8\u8a8d\u7684\u7528\u6236\u540d\u548c\u5bc6\u78bc\uff08\u901a\u5e38\u662froot\u548c\u7a7a\u5bc6\u78bc\uff09\u767b\u9304\u3002<\/li>\n<li>\u5728\u201c\u6578\u64da\u5eab\u201d\u9078\u9805\u5361\u4e2d\uff0c\u8f38\u5165\u65b0\u6578\u64da\u5eab\u7684\u540d\u7a31\uff0c\u7136\u5f8c\u9ede\u64ca\u201c\u5275\u5efa\u201d\u3002<\/li>\n<\/ol>\n<h2 id=\"%e7%b7%a8%e5%af%abphp%e4%bb%a3%e7%a2%bc%e9%80%a3%e6%8e%a5%e6%95%b8%e6%93%9a%e5%ba%ab-PqULEnQEXp\">\u7de8\u5bebPHP\u4ee3\u78bc\u9023\u63a5\u6578\u64da\u5eab<\/h2>\n<p>\u5275\u5efa\u6578\u64da\u5eab\u5f8c\uff0c\u60a8\u53ef\u4ee5\u7de8\u5bebPHP\u4ee3\u78bc\u4f86\u9023\u63a5\u6578\u64da\u5eab\u3002\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>&lt;?php\n$servername = \"localhost\";\n$username = \"root\";\n$password = \"\";\n$dbname = \"your_database_name\";\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;<\/code><\/pre>\n<p>\u5728\u9019\u6bb5\u4ee3\u78bc\u4e2d\uff0c\u6211\u5011\u4f7f\u7528\u4e86mysqli\u64f4\u5c55\u4f86\u9023\u63a5MySQL\u6578\u64da\u5eab\u3002\u8acb\u6839\u64da\u60a8\u7684\u6578\u64da\u5eab\u540d\u7a31\u9032\u884c\u76f8\u61c9\u7684\u4fee\u6539\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-PqULEnQEXp\">\u7e3d\u7d50<\/h2>\n<p>\u4f7f\u7528PHPStudy\u642d\u5efa\u52d5\u614b\u6578\u64da\u5eab\u74b0\u5883\u662f\u4e00\u500b\u7c21\u55ae\u800c\u9ad8\u6548\u7684\u904e\u7a0b\u3002\u7121\u8ad6\u60a8\u662f\u521d\u5b78\u8005\u9084\u662f\u6709\u7d93\u9a57\u7684\u958b\u767c\u8005\uff0c\u9019\u6b3e\u5de5\u5177\u90fd\u80fd\u5e6b\u52a9\u60a8\u5feb\u901f\u642d\u5efa\u672c\u5730\u958b\u767c\u74b0\u5883\uff0c\u9032\u884c\u6e2c\u8a66\u548c\u958b\u767c\u3002\u82e5\u60a8\u9700\u8981\u66f4\u9ad8\u6548\u7684\u958b\u767c\u74b0\u5883\uff0c\u8003\u616e\u4f7f\u7528<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u4f86\u90e8\u7f72\u60a8\u7684\u61c9\u7528\uff0c\u9019\u6a23\u53ef\u4ee5\u7372\u5f97\u66f4\u597d\u7684\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f15\u9b06\u4f7f\u7528PHPStudy\u642d\u5efa\u52d5\u614b\u6578\u64da\u5eab\u74b0\u5883\uff0c\u5feb\u901f\u958b\u767c\u8207\u6e2c\u8a66PHP\u61c9\u7528\uff0c\u63d0\u5347\u958b\u767c\u6548\u7387\uff0c\u9069\u5408\u65b0\u624b\u8207\u5c08\u696d\u4eba\u58eb\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-96458","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96458","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"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=96458"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96458\/revisions"}],"predecessor-version":[{"id":96459,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/96458\/revisions\/96459"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=96458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=96458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=96458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}