{"id":6849,"date":"2022-01-03T12:36:12","date_gmt":"2022-01-03T12:36:12","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=6849"},"modified":"2026-02-26T14:03:07","modified_gmt":"2026-02-26T14:03:07","slug":"use-the-terminal-to-run-php-commands","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/","title":{"rendered":"How To Use The Terminal To Run PHP Commands"},"content":{"rendered":"<p><strong><\/strong><\/p>\r\n<p class=\"wp-block-paragraph\">If you&#8217;re looking for a way to run PHP commands from a terminal, you&#8217;ve come to the right place. Here you&#8217;ll find all the information you need about PHP commands.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Methodology<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">SSH is being used to access the server.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">If you are a WHM Administrator, you need to access the server via SSH as root, then switch to the user with the following instructions, try to replace $username with the username that owns the script you are simply trying to execute. \u00a0<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p class=\"wp-block-paragraph\">su &#8211; $username -s \/bin\/bash<\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">While using cPanel, ensure you have shell access first. If you have shell access, the Terminal app in cPanel will be available. Your hosting provider will need to enable the Terminal app if you haven&#8217;t already in cPanel. Log in via SSH or open the Terminal app in cPanel.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Determine the PHP version of the user.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>Follow the following steps to evaluate a user&#8217;s PHP version:<\/strong><\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">WHM&#8217;s MultiPHP Manager interface<\/p>\r\n\r\n\r\n\r\n<ol>\r\n<li>Log in to &#8220;WHM as root user&#8221;\u00a0<br \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6850\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3.png\" alt=\"\" width=\"200\" height=\"186\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3.png 370w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3-300x279.png 300w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3-230x214.png 230w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3-350x325.png 350w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/li>\r\n<li>Now search for the &#8220;Software&#8221;<br \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6851\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-4.png\" alt=\"\" width=\"450\" height=\"241\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-4.png 622w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-4-300x161.png 300w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-4-230x123.png 230w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-4-350x187.png 350w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-4-480x257.png 480w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/li>\r\n<li>Click on the &#8220;MultiPHP Manager&#8221;<br \/><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-6852\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_3-2-1024x282.png\" alt=\"\" width=\"710\" height=\"195\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_3-2-1024x282.png 1024w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_3-2-300x83.png 300w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_3-2-768x212.png 768w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_3-2-830x229.png 830w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_3-2-230x63.png 230w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_3-2-350x97.png 350w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_3-2-480x132.png 480w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_3-2.png 1037w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><br \/>The default PHP version of a user can be viewed and changed using this GUI. This is the most straightforward method of determining a user&#8217;s PHP version.<br \/><br \/>cPanel\u2019s MultiPHP Manager Interface (cPanel &gt;&gt; Home &gt;&gt; Software &gt;&gt; MultiPHP Manager)<br \/><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-6853\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-5.png\" alt=\"\" width=\"765\" height=\"148\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-5.png 949w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-5-300x58.png 300w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-5-768x150.png 768w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-5-830x162.png 830w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-5-230x45.png 230w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-5-350x68.png 350w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_1-5-480x94.png 480w\" sizes=\"auto, (max-width: 765px) 100vw, 765px\" \/><br \/>\r\n<p class=\"wp-block-paragraph\">Go to the directory \/home\/username\/public HTML, where &#8220;username&#8221; is the user&#8217;s username. Use this command line to run<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">cat .htaccess<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"># php &#8212; BEGIN cPanel-generated handler, do not edit<br \/># Set the \u201cea-php73\u201d package as the default \u201cPHP\u201d programming language.<br \/>&lt;IfModule mime_module&gt;<br \/>\u00a0 \u00a0 AddHandler application\/x-httpd-ea-php73 .php .php7 .phtml<br \/>&lt;\/IfModule&gt;<br \/># php &#8212; END cPanel-generated handler, do not edit<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u2022 Set the \u201cea-php73\u201d package as the default in the above example indicates that the site is using the EasyApache PHP 7.3 supported by cPanel.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u2022 PHP get host version is a feature in WHM API 1 that you can use.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">\u2022 Make use of the UAPI feature LangPHP::php get host versions.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Find the PHP binary.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Replace the XX with the version number found in the previous step for EasyApache &#8220;ea&#8221; PHP variants:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">\/opt\/cpanel\/ea-phpXX\/root\/usr\/bin\/php<\/pre>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Replace the XX with the version number found in the previous stage for CloudLinux &#8220;alt&#8221; PHP variants:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">\/opt\/cloudlinux\/alt-phpXX\/root\/usr\/bin\/php<\/pre>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Run the script.<\/p>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">To begin, make sure you&#8217;re in the same directory as the script. Replace $user with the username of the script&#8217;s owner and $path with the actual path to the file&#8217;s location.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">cd \/home\/$user\/$path<\/pre>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Next, make certain that you are running as the user.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">whoami<\/pre>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">Run the script, replacing the path to the PHP binary with the one found in the previous section and &#8220;script.php&#8221; with the script&#8217;s name.<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>\/opt\/$vendor\/xx-phpXX\/root\/usr\/bin\/php .\/script.php<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\">We hope that you now have a good understanding of How To Use The Terminal To Run PHP Commands. If you continue to have problems with the protocol outlined above, please contact the <a href=\"https:\/\/www.bodhost.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">bodHOST <\/a>Team for constructive assistance 24\/7.<\/p>\r\n<p>Looking to master command line skills? Discover essential <a href=\"https:\/\/www.bodhost.com\/kb\/windows-cmd-commands-cheat-sheet\/\" target=\"_blank\" rel=\"noopener\">Windows CMD Commands Cheat Sheet<\/a> for efficient file management and system troubleshooting in Windows CMD.<\/p>\r\n<p><strong><\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re looking for a way to run PHP commands from a terminal, you&#8217;ve come to the right place. Here you&#8217;ll find all the information you need about PHP commands.&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":22,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[837],"tags":[354,996,194],"class_list":["post-6849","post","type-post","status-publish","format-standard","hentry","category-tutorial","tag-linux","tag-php-commands","tag-whm"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Use the Terminal to Run PHP Commands | bodHOST<\/title>\n<meta name=\"description\" content=\"In this tutorial, we have\u00a0demonstrated how to Run PHP Commands from the Terminal. For more information, you can visit our website\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use the Terminal to Run PHP Commands | bodHOST\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we have\u00a0demonstrated how to Run PHP Commands from the Terminal. For more information, you can visit our website\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-03T12:36:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:03:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"370\" \/>\n\t<meta property=\"og:image:height\" content=\"344\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Vincer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vincer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/\"},\"author\":{\"name\":\"Vincer\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/f3852d74aeac480763235276b5faddd0\"},\"headline\":\"How To Use The Terminal To Run PHP Commands\",\"datePublished\":\"2022-01-03T12:36:12+00:00\",\"dateModified\":\"2026-02-26T14:03:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/\"},\"wordCount\":525,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/Screenshot_2-3.png\",\"keywords\":[\"Linux\",\"PHP Commands\",\"WHM\"],\"articleSection\":[\"Tutorial\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/\",\"name\":\"How to Use the Terminal to Run PHP Commands | bodHOST\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/Screenshot_2-3.png\",\"datePublished\":\"2022-01-03T12:36:12+00:00\",\"dateModified\":\"2026-02-26T14:03:07+00:00\",\"description\":\"In this tutorial, we have\u00a0demonstrated how to Run PHP Commands from the Terminal. For more information, you can visit our website\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/Screenshot_2-3.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/04\\\/Screenshot_2-3.png\",\"width\":370,\"height\":344},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/use-the-terminal-to-run-php-commands\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Tutorial\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Use The Terminal To Run PHP Commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/f3852d74aeac480763235276b5faddd0\",\"name\":\"Vincer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g\",\"caption\":\"Vincer\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/vinayak\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use the Terminal to Run PHP Commands | bodHOST","description":"In this tutorial, we have\u00a0demonstrated how to Run PHP Commands from the Terminal. For more information, you can visit our website","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/","og_locale":"en_US","og_type":"article","og_title":"How to Use the Terminal to Run PHP Commands | bodHOST","og_description":"In this tutorial, we have\u00a0demonstrated how to Run PHP Commands from the Terminal. For more information, you can visit our website","og_url":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2022-01-03T12:36:12+00:00","article_modified_time":"2026-02-26T14:03:07+00:00","og_image":[{"width":370,"height":344,"url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3.png","type":"image\/png"}],"author":"Vincer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Vincer","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/"},"author":{"name":"Vincer","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/f3852d74aeac480763235276b5faddd0"},"headline":"How To Use The Terminal To Run PHP Commands","datePublished":"2022-01-03T12:36:12+00:00","dateModified":"2026-02-26T14:03:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/"},"wordCount":525,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3.png","keywords":["Linux","PHP Commands","WHM"],"articleSection":["Tutorial"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/","url":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/","name":"How to Use the Terminal to Run PHP Commands | bodHOST","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/#primaryimage"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3.png","datePublished":"2022-01-03T12:36:12+00:00","dateModified":"2026-02-26T14:03:07+00:00","description":"In this tutorial, we have\u00a0demonstrated how to Run PHP Commands from the Terminal. For more information, you can visit our website","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/#primaryimage","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/04\/Screenshot_2-3.png","width":370,"height":344},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/use-the-terminal-to-run-php-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Tutorial","item":"https:\/\/www.bodhost.com\/kb\/category\/tutorial\/"},{"@type":"ListItem","position":2,"name":"How To Use The Terminal To Run PHP Commands"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/f3852d74aeac480763235276b5faddd0","name":"Vincer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bb5079f76e01aaa97b2ffcb7a562292482693b395aba4a4214c98f006c07d352?s=96&d=mm&r=g","caption":"Vincer"},"url":"https:\/\/www.bodhost.com\/kb\/author\/vinayak\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/6849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/22"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=6849"}],"version-history":[{"count":11,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/6849\/revisions"}],"predecessor-version":[{"id":13518,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/6849\/revisions\/13518"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=6849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=6849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=6849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}