{"id":273,"date":"2025-05-22T03:22:21","date_gmt":"2025-05-22T03:22:21","guid":{"rendered":"https:\/\/blog.chaiyakul.com\/?p=273"},"modified":"2025-05-22T06:03:40","modified_gmt":"2025-05-22T06:03:40","slug":"mysqli-docker-php-5-6-fpm-centos-9","status":"publish","type":"post","link":"https:\/\/blog.chaiyakul.com\/index.php\/2025\/05\/22\/mysqli-docker-php-5-6-fpm-centos-9\/","title":{"rendered":"\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 mysqli \u0e43\u0e19 Docker PHP 5.6 FPM \u0e43\u0e19\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07 CentOS 9"},"content":{"rendered":"\n<p>\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e43\u0e19 container \u0e17\u0e35\u0e48\u0e23\u0e31\u0e19 PHP \u0e01\u0e48\u0e2d\u0e19<\/p>\n\n\n\n<p>\u0e43\u0e0a\u0e49\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e14\u0e39 container \u0e17\u0e35\u0e48\u0e01\u0e33\u0e25\u0e31\u0e07\u0e23\u0e31\u0e19:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndocker ps\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e25\u0e49\u0e27\u0e43\u0e0a\u0e49\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e40\u0e02\u0e49\u0e32 container:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\ndocker exec -it &lt;container_id_or_name&gt; \/bin\/bash\n<\/pre><\/div>\n\n\n<p>\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e25\u0e2d\u0e07\u0e23\u0e31\u0e19<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndocker-php-ext-install mysqli\n<\/pre><\/div>\n\n\n<p><u><strong>\u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e16\u0e31\u0e14\u0e44\u0e1b\u0e17\u0e35\u0e48\u0e04\u0e27\u0e23\u0e17\u0e33<\/strong><\/u><\/p>\n\n\n\n<p>1.\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e27\u0e48\u0e32 <code>mysqli<\/code> \u0e16\u0e39\u0e01\u0e42\u0e2b\u0e25\u0e14\u0e43\u0e19 <code>php.ini<\/code> \u0e2b\u0e23\u0e37\u0e2d\u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c config \u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngrep -r mysqli \/usr\/local\/etc\/php\/\n<\/pre><\/div>\n\n\n<p>\u0e14\u0e39\u0e27\u0e48\u0e32\u0e21\u0e35\u0e1a\u0e23\u0e23\u0e17\u0e31\u0e14 <code>extension=mysqli.so<\/code> \u0e2b\u0e23\u0e37\u0e2d <code>extension=mysqli<\/code> \u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c\u0e44\u0e2b\u0e19\u0e1a\u0e49\u0e32\u0e07<\/p>\n\n\n\n<p>2.\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17\u0e40\u0e27\u0e47\u0e1a\u0e40\u0e0b\u0e34\u0e23\u0e4c\u0e1f\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e2b\u0e23\u0e37\u0e2d PHP-FPM (\u0e41\u0e25\u0e49\u0e27\u0e41\u0e15\u0e48\u0e04\u0e38\u0e13\u0e43\u0e0a\u0e49\u0e15\u0e31\u0e27\u0e44\u0e2b\u0e19)<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nservice php-fpm restart\n<\/pre><\/div>\n\n\n<p>3.\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e27\u0e48\u0e32 PHP \u0e42\u0e2b\u0e25\u0e14 extension <code>mysqli<\/code> \u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nphp -m | grep mysqli\n<\/pre><\/div>\n\n\n<p>\u0e08\u0e32\u0e01\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e19\u0e35\u0e49<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/usr\/local\/etc\/php\/conf.d\/docker-php-ext-mysqli.ini:extension=mysqli.so\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e1b\u0e25\u0e27\u0e48\u0e32 <code>mysqli<\/code> \u0e16\u0e39\u0e01 enable \u0e1c\u0e48\u0e32\u0e19\u0e44\u0e1f\u0e25\u0e4c config \u0e17\u0e35\u0e48 <code>conf.d\/docker-php-ext-mysqli.ini<\/code> \u0e41\u0e25\u0e49\u0e27\u0e19\u0e30\u0e04\u0e23\u0e31\u0e1a<\/p>\n\n\n\n<p>4.\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07\u0e27\u0e48\u0e32\u0e1b\u0e31\u0e0d\u0e2b\u0e32 <strong>Database connection error<\/strong> \u0e2b\u0e32\u0e22\u0e44\u0e1b\u0e2b\u0e23\u0e37\u0e2d\u0e22\u0e31\u0e07<\/p>\n\n\n\n<p><strong><u>\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\u0e27\u0e34\u0e18\u0e35\u0e23\u0e35\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17<\/u><\/strong><\/p>\n\n\n\n<p>\u0e27\u0e34\u0e18\u0e35\u0e23\u0e35\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17\u0e40\u0e27\u0e47\u0e1a\u0e40\u0e0b\u0e34\u0e23\u0e4c\u0e1f\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e2b\u0e23\u0e37\u0e2d PHP-FPM \u0e02\u0e36\u0e49\u0e19\u0e01\u0e31\u0e1a\u0e27\u0e48\u0e32\u0e43\u0e19 Docker container \u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e2d\u0e30\u0e44\u0e23\u0e2d\u0e22\u0e39\u0e48 \u0e16\u0e49\u0e32\u0e44\u0e21\u0e48\u0e41\u0e19\u0e48\u0e43\u0e08\u0e25\u0e2d\u0e07\u0e40\u0e0a\u0e47\u0e04\u0e14\u0e39\u0e15\u0e32\u0e21\u0e19\u0e35\u0e49\u0e04\u0e23\u0e31\u0e1a<\/p>\n\n\n\n<p>\u0e23\u0e35\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17 container \u0e08\u0e32\u0e01\u0e1d\u0e31\u0e48\u0e07\u0e42\u0e2e\u0e2a\u0e15\u0e4c Docker \u0e41\u0e17\u0e19<\/p>\n\n\n\n<p>1.\u0e2d\u0e2d\u0e01\u0e08\u0e32\u0e01 container (\u0e16\u0e49\u0e32\u0e2d\u0e22\u0e39\u0e48\u0e43\u0e19 shell container)<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nexit\n<\/pre><\/div>\n\n\n<p>2.\u0e40\u0e0a\u0e47\u0e04 container \u0e17\u0e35\u0e48\u0e01\u0e33\u0e25\u0e31\u0e07\u0e23\u0e31\u0e19<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndocker ps\n<\/pre><\/div>\n\n\n<p>3.\u0e23\u0e35\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17 container \u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\ndocker restart &lt;container_id_or_name&gt;\n<\/pre><\/div>\n\n\n<p>\u0e40\u0e0a\u0e48\u0e19<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndocker restart 8999998507019\n<\/pre><\/div>\n\n\n<p>\u0e27\u0e34\u0e18\u0e35\u0e23\u0e35\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17 PHP-FPM \u0e43\u0e19 container \u0e19\u0e35\u0e49<\/p>\n\n\n\n<p>\u0e07\u0e48\u0e32\u0e22\u0e17\u0e35\u0e48\u0e2a\u0e38\u0e14\u0e04\u0e37\u0e2d\u0e23\u0e35\u0e2a\u0e15\u0e32\u0e23\u0e4c\u0e17 container \u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14\u0e40\u0e25\u0e22:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ndocker restart php56-fpm\n<\/pre><\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e40\u0e02\u0e49\u0e32\u0e44\u0e1b\u0e43\u0e19 container \u0e17\u0e35\u0e48\u0e23\u0e31\u0e19 PHP \u0e01\u0e48\u0e2d\u0e19 \u0e43\u0e0a\u0e49\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e14\u0e39 containe [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","footnotes":""},"categories":[105,9,117],"tags":[],"class_list":["post-273","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-sql"],"_links":{"self":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/comments?post=273"}],"version-history":[{"count":3,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/273\/revisions"}],"predecessor-version":[{"id":283,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/273\/revisions\/283"}],"wp:attachment":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/media?parent=273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/categories?post=273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/tags?post=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}