{"id":318,"date":"2025-08-10T08:27:45","date_gmt":"2025-08-10T08:27:45","guid":{"rendered":"https:\/\/blog.chaiyakul.com\/?p=318"},"modified":"2025-08-10T08:27:45","modified_gmt":"2025-08-10T08:27:45","slug":"check-user-run-php-centos9","status":"publish","type":"post","link":"https:\/\/blog.chaiyakul.com\/index.php\/2025\/08\/10\/check-user-run-php-centos9\/","title":{"rendered":"\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a user \u0e17\u0e35\u0e48\u0e23\u0e31\u0e19 PHP \u0e43\u0e19 CentOS9"},"content":{"rendered":"\n<p>\u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e44\u0e14\u0e49\u0e07\u0e48\u0e32\u0e22 \u0e46 \u0e27\u0e48\u0e32 <strong>PHP \u0e16\u0e39\u0e01\u0e1b\u0e23\u0e30\u0e21\u0e27\u0e25\u0e1c\u0e25\u0e20\u0e32\u0e22\u0e43\u0e15\u0e49 user \u0e44\u0e2b\u0e19<\/strong><br>\u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49 <code>phpinfo()<\/code> \u0e2b\u0e23\u0e37\u0e2d <code>whoami<\/code> \u0e04\u0e23\u0e31\u0e1a<\/p>\n\n\n\n<p>\u0e27\u0e34\u0e18\u0e35\u0e17\u0e35\u0e48 1 \u2014 \u0e43\u0e0a\u0e49 <code>whoami<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\necho shell_exec(&#039;whoami&#039;);\n<\/pre><\/div>\n\n\n<p>\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e08\u0e30\u0e1a\u0e2d\u0e01\u0e0a\u0e37\u0e48\u0e2d user \u0e17\u0e35\u0e48\u0e23\u0e31\u0e19 PHP \u0e40\u0e0a\u0e48\u0e19<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\napache\n<\/pre><\/div>\n\n\n<p>\u0e2b\u0e23\u0e37\u0e2d<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nwww-data\n<\/pre><\/div>\n\n\n<p>\u0e27\u0e34\u0e18\u0e35\u0e17\u0e35\u0e48 2 \u2014 \u0e43\u0e0a\u0e49 <code>phpinfo()<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\nphpinfo();\n<\/pre><\/div>\n\n\n<p>\u0e41\u0e25\u0e49\u0e27\u0e14\u0e39\u0e43\u0e19\u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d <strong>Environment<\/strong> \u0e2b\u0e23\u0e37\u0e2d <strong>User\/Group<\/strong><br>\u0e08\u0e30\u0e40\u0e2b\u0e47\u0e19\u0e27\u0e48\u0e32\u0e23\u0e31\u0e19\u0e43\u0e19 user \u0e44\u0e2b\u0e19\u0e41\u0e25\u0e30 group \u0e2d\u0e30\u0e44\u0e23<\/p>\n\n\n\n<p>\u0e27\u0e34\u0e18\u0e35\u0e17\u0e35\u0e48 3 \u2014 \u0e43\u0e0a\u0e49 <code>posix_getpwuid()<\/code><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\n$user = posix_getpwuid(posix_geteuid());\necho $user&#x5B;&#039;name&#039;];\n<\/pre><\/div>\n\n\n<p>\u0e08\u0e30\u0e41\u0e2a\u0e14\u0e07\u0e0a\u0e37\u0e48\u0e2d user \u0e40\u0e0a\u0e48\u0e19 <code>apache<\/code>, <code>nginx<\/code>, \u0e2b\u0e23\u0e37\u0e2d <code>www-data<\/code><\/p>\n\n\n\n<p>\u0e43\u0e19 CentOS 9 \u0e16\u0e49\u0e32\u0e43\u0e0a\u0e49 Apache \u0e1b\u0e01\u0e15\u0e34 user \u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19 <strong><code>apache<\/code><\/strong><br>\u0e16\u0e49\u0e32\u0e43\u0e0a\u0e49 Nginx + PHP-FPM \u0e1b\u0e01\u0e15\u0e34\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19 <strong><code>nginx<\/code><\/strong> \u0e2b\u0e23\u0e37\u0e2d\u0e17\u0e35\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e44\u0e27\u0e49\u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c <code>php-fpm.conf<\/code><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e04\u0e38\u0e13\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e44\u0e14\u0e49\u0e07\u0e48\u0e32\u0e22 \u0e46 \u0e27\u0e48\u0e32 PHP \u0e16\u0e39\u0e01\u0e1b\u0e23\u0e30\u0e21\u0e27\u0e25\u0e1c\u0e25\u0e20\u0e32\u0e22\u0e43\u0e15\u0e49 use [&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":[118,105,9,161],"tags":[],"class_list":["post-318","post","type-post","status-publish","format-standard","hentry","category-apache","category-centos","category-linux","category-php"],"_links":{"self":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/318","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=318"}],"version-history":[{"count":1,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":319,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/posts\/318\/revisions\/319"}],"wp:attachment":[{"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.chaiyakul.com\/index.php\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}