{"id":68,"date":"2020-05-27T17:45:01","date_gmt":"2020-05-27T08:45:01","guid":{"rendered":"https:\/\/speedloger.com\/?p=68"},"modified":"2020-05-27T20:34:14","modified_gmt":"2020-05-27T11:34:14","slug":"azure-app-service%e3%81%aemysql-in-app%e3%82%92wordpress%e3%81%8b%e3%82%89%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"https:\/\/speedloger.com\/?p=68","title":{"rendered":"Azure App Service\u306eMySQL in App\u3092WordPress\u304b\u3089\u4f7f\u3046"},"content":{"rendered":"<p>AppService\u5074\u3067\u8a2d\u5b9a\u3057\u305f\u5024\u3067\u30a2\u30af\u30bb\u30b9<\/p>\n<h1>wp-config.php\u3092\u66f8\u304d\u63db\u3048<\/h1>\n<pre><code>&lt;?php\nif(!isset($_SERVER[&quot;MYSQLCONNSTR_localdb&quot;])) throw new Exception(&#039;MYSQLCONNSTR ENV is not defined&#039;);\n\n$azure_mysql_connstr = $_SERVER[&quot;MYSQLCONNSTR_localdb&quot;];\n$azure_mysql_connstr_match = preg_match(\n  &quot;\/&quot;.\n    &quot;Database=(?&lt;database&gt;.+);&quot;.\n    &quot;Data Source=(?&lt;datasource&gt;.+):&quot;.\n    &quot;(?&lt;port&gt;.+);&quot;.\n    &quot;User Id=(?&lt;userid&gt;.+);&quot;.\n    &quot;Password=(?&lt;password&gt;.+)&quot;.\n  &quot;\/u&quot;,\n  $azure_mysql_connstr,\n  $_);\n\nif($azure_mysql_connstr_match === false) throw new Exception(&#039;Could not parse for MYSQLCONNSTR ENV&#039;);\n\n$db_settings = [\n    &#039;host&#039;      =&gt; $_[&#039;datasource&#039;],\n    &#039;port&#039;      =&gt; $_[&#039;port&#039;],\n    &#039;database&#039;  =&gt; $_[&#039;database&#039;],\n    &#039;username&#039;  =&gt; $_[&#039;userid&#039;],\n    &#039;password&#039;  =&gt; $_[&#039;password&#039;],\n];\n\nvar_dump($db_settings);\n?&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>AppService\u5074\u3067\u8a2d\u5b9a\u3057\u305f\u5024\u3067\u30a2\u30af\u30bb\u30b9 wp-config.php\u3092\u66f8\u304d\u63db\u3048 &lt;?php if(!isset($_SERVER[&quot;MYSQLCONNSTR_localdb&quot;])) thro&#8230; &raquo; <a class=\"read-more-link\" href=\"https:\/\/speedloger.com\/?p=68\">read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":""},"categories":[7,6],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mynote-thumbnail":false,"mynote-medium":false},"uagb_author_info":{"display_name":"\u7ba1\u7406\u30a2\u30ab\u30a6\u30f3\u30c8","author_link":"https:\/\/speedloger.com\/?author=1"},"uagb_comment_info":0,"uagb_excerpt":"AppService\u5074\u3067\u8a2d\u5b9a\u3057\u305f\u5024\u3067\u30a2\u30af\u30bb\u30b9 wp-config.php\u3092\u66f8\u304d\u63db\u3048 &lt;?php if(!&hellip;","_links":{"self":[{"href":"https:\/\/speedloger.com\/index.php?rest_route=\/wp\/v2\/posts\/68"}],"collection":[{"href":"https:\/\/speedloger.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/speedloger.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/speedloger.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/speedloger.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=68"}],"version-history":[{"count":0,"href":"https:\/\/speedloger.com\/index.php?rest_route=\/wp\/v2\/posts\/68\/revisions"}],"wp:attachment":[{"href":"https:\/\/speedloger.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/speedloger.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/speedloger.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}