{"id":5037,"date":"2023-02-01T16:25:23","date_gmt":"2023-02-01T16:25:23","guid":{"rendered":"https:\/\/arzhost.com\/blogs\/?p=5037"},"modified":"2025-09-15T15:23:09","modified_gmt":"2025-09-15T10:23:09","slug":"how-to-check-your-php-version","status":"publish","type":"post","link":"https:\/\/arzhost.com\/blogs\/how-to-check-your-php-version\/","title":{"rendered":"How To Check Your PHP Version: A Simple Guide"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_74 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/arzhost.com\/blogs\/how-to-check-your-php-version\/#Overview_of_PHP_and_Its_Importance\" >Overview of PHP and Its Importance<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/arzhost.com\/blogs\/how-to-check-your-php-version\/#How_to_Check_Your_PHP_Version_Methods_to_Determine_Your_PHP_Version\" >How to Check Your PHP Version: Methods to Determine Your PHP Version<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/arzhost.com\/blogs\/how-to-check-your-php-version\/#Run_PHP_Code_to_Verify_PHP_Version_Executing_PHP_Code\" >Run PHP Code to Verify PHP Version: Executing PHP Code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/arzhost.com\/blogs\/how-to-check-your-php-version\/#Flash_Sale_Alert_Up_to_90_Off_on_All_Hosting_Plans_%E2%80%93_Act_Fast\" >Flash Sale Alert! Up to 90% Off on All Hosting Plans &#8211; Act Fast!<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/arzhost.com\/blogs\/how-to-check-your-php-version\/#Command_Line_Instructions_for_Different_Operating_Systems_to_Check_the_Version_of_PHP\" >Command Line Instructions for Different Operating Systems to Check the Version of PHP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/arzhost.com\/blogs\/how-to-check-your-php-version\/#Correct_%E2%80%9CPHP_is_not_Recognized%E2%80%9D_Mistake_on_Windows_Troubleshooting\" >Correct \u201cPHP is not Recognized\u201d Mistake on Windows: Troubleshooting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/arzhost.com\/blogs\/how-to-check-your-php-version\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Overview_of_PHP_and_Its_Importance\"><\/span>Overview of PHP and Its Importance<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>New PHP versions are typically delayed to be implemented by hosting companies on their systems. As a result, <strong>how to Check Your PHP Version<\/strong>? there are numerous PHP versions available online at any given time.<\/p>\n\n\n\n<p>Knowing which PHP version your web server is using is crucial if you&#8217;re adding new features, setting up a new PHP-based application, or looking for bugs on your website.<\/p>\n\n\n\n<p>You will discover how to verify How To Check Your PHP Version? in this lesson in our <a href=\"https:\/\/arzhost.com\/blogs\/\"><strong>Blog<\/strong><\/a> by executing PHP code on your server or by using the command line.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Check_Your_PHP_Version_Methods_to_Determine_Your_PHP_Version\"><\/span><strong>How to Check Your PHP Version<\/strong>: Methods to Determine Your PHP Version<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><strong><a href=\"https:\/\/arzhost.com\/blogs\/what-is-php-and-how-does-its-power-wordpress\/\" data-type=\"link\" data-id=\"https:\/\/arzhost.com\/blogs\/what-is-php-and-how-does-its-power-wordpress\/\">PHP (Hypertext Preprocessor)<\/a> is a widely used open-source scripting language<\/strong>&nbsp;that is especially suited for web development and can be embedded into HTML. It is a server-side language, which means that it runs on the server and generates dynamic content that is sent to the client\u2019s web browser.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>PHP installed<\/strong><\/li>\n\n\n\n<li><strong>Write access to the server\u2019s file system<\/strong><\/li>\n\n\n\n<li><strong>Access to the command line<\/strong><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Run_PHP_Code_to_Verify_PHP_Version_Executing_PHP_Code\"><\/span>Run PHP Code to Verify PHP Version: Executing PHP Code<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Executing a PHP file containing the following code will reveal the <strong>PHP version<\/strong> that is currently in use on your website.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;?php<\/code><\/li>\n\n\n\n<li><code>PHP version (); echo \"PHP version:\"<\/code><\/li>\n<\/ul>\n\n\n\n<p>Upload the file to your website&#8217;s document root directory after creating it in a text editor like gedit or Notepad.<\/p>\n\n\n\n<p><u>Then launch a web browser and enter the complete file address in the address box. To upload a file named phpinfo. Php to the root directory of example.com, for instance, go to:<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>http:\/\/www.example.com\/phpinfo.php<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>The code above just displays the PHP version, as shown in the output below:<\/u><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"536\" title=\"execute to verify php code\" src=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/execute-to-verify-php-code-1024x536.jpg\" alt=\"execute to verify php code\" class=\"wp-image-13106\" srcset=\"https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/execute-to-verify-php-code-1024x536.jpg 1024w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/execute-to-verify-php-code-300x157.jpg 300w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/execute-to-verify-php-code-768x402.jpg 768w, https:\/\/arzhost.com\/blogs\/wp-content\/uploads\/2025\/09\/execute-to-verify-php-code.jpg 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">execute to verify php code<\/figcaption><\/figure><\/div>\n\n\n<p><\/p>\n\n\n\n<p>Upload a file containing the phpinfo () function if you need more information about your PHP configuration, such as system information, the build date, server API, configuration file information, etc.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;? php<\/code><\/li>\n\n\n\n<li><code>phpinfo ();<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>This file displays the PHP version in the top-left corner of the browser window, followed by configuration information<\/u><\/p>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-4d9a02ab wp-block-button uag-blocks-common-selector\" style=\"--z-index-desktop:479;;--z-index-tablet:undefined;;--z-index-mobile:undefined;\"><div class=\"uagb-cta__wrap\"><h2 class=\"uagb-cta__title\"><span class=\"ez-toc-section\" id=\"Flash_Sale_Alert_Up_to_90_Off_on_All_Hosting_Plans_%E2%80%93_Act_Fast\"><\/span><a href=\"https:\/\/arzhost.com\/web-hosting\/\" data-type=\"link\" data-id=\"https:\/\/arzhost.com\/web-hosting\/\"><strong>Flash Sale Alert! Up to 90% Off on All Hosting Plans &#8211; Act Fast!<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"uagb-cta__desc\">Reliable Hosting, Affordable Prices &#8211; Sign Up Today and Enjoy a Free Domain Name!<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/arzhost.com\/web-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_self\" rel=\"noopener noreferrer\">Read More<\/a><\/div><\/div>\n\n\n\n<p><u>Upload a file with the following code to get a list of all the loaded PHP extensions and their versions:<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;?php<\/code><\/li>\n\n\n\n<li><code>get loaded extensions () as I =&gt; $ext, for each<\/code><\/li>\n\n\n\n<li><code>{<\/code><\/li>\n\n\n\n<li><code>echo \"$ext\". \"=&gt; \". phpversion($ext). \"br\/&gt;\";<\/code><\/li>\n\n\n\n<li><code>}<\/code><\/li>\n<\/ul>\n\n\n\n<p>Each extension is displayed separately in the output together with the PHP core version<\/p>\n\n\n\n<p>Related article: <a href=\"https:\/\/arzhost.com\/blogs\/how-to-update-php-in-wordpress\/\"><strong>How to Update PHP in WordPress<\/strong><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Command_Line_Instructions_for_Different_Operating_Systems_to_Check_the_Version_of_PHP\"><\/span><strong>Command Line Instructions for Different Operating Systems to Check the Version of PHP<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Use the command line to look up the installed PHP version if you have access to SSH into the remote server. The local installation of PHP can be verified using this method as well.<\/p>\n\n\n\n<p><u>1: Enter the PHP command.<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>php -v<\/code><\/li>\n<\/ul>\n\n\n\n<p>2: Linux, macOS, Windows, and other supported operating systems all support the php -v command. The output includes copyright information as well as the PHP version number and build date.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Correct_%E2%80%9CPHP_is_not_Recognized%E2%80%9D_Mistake_on_Windows_Troubleshooting\"><\/span><strong>Correct \u201cPHP is not Recognized\u201d Mistake on Windows: Troubleshooting<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>How to Check PHP Version? The PHP -v command on Windows occasionally returns the message &#8220;php is not recognized&#8221; because the system does not recognize the PHP path.<\/p>\n\n\n\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/qXf9N3lYqAk\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n\n<p>Set the PATH environment variable first to fix this issue.<\/p>\n\n\n\n<p><u>1: Enter the path to your PHP installation in place of [location] in the command below.<\/u><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>establish PATH=%PATH%;[location]<\/code><\/li>\n<\/ul>\n\n\n\n<p><u>2: The PHP version installed on your Windows machine is now displayed when you use php -v.<\/u><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The purpose of this post was to describe how to verify How to Check PHP Version. installed on your server or local computer. The command-line interface and running PHP code are two of the techniques discussed in this lesson.<\/p>\n\n\n\n<p>For reliable and scalable hosting solutions, make sure to visit <a href=\"https:\/\/arzhost.com\/\"><strong>ARZ Host<\/strong><\/a>.<\/p>\n\n\n\n<p><strong>Latest Posts:<\/strong><\/p>\n\n\n<ul class=\"wp-block-latest-posts__list wp-block-latest-posts\"><li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/how-to-fix-403-forbidden-error-wordpress\/\">How To Fix 403 Forbidden Error WordPress<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/how-to-get-the-most-out-of-claude-ai\/\">How To Get The Most Out Of Claude Ai<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/bad-gateway-error-502-the-ultimate-guide-to-quick-fixes\/\">Bad Gateway Error (502): The Ultimate Guide to Quick Fixes<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/a-deep-dive-into-todays-best-linux-distros\/\">A Deep Dive Into Today\u2019s Best Linux Distros<\/a><\/li>\n<li><a class=\"wp-block-latest-posts__post-title\" href=\"https:\/\/arzhost.com\/blogs\/domain-investor-terms-powerful-strategy\/\">Domain Investor Terms: Expert Insight on Powerful Strategy<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Overview of PHP and Its Importance New PHP versions are typically delayed to be implemented by hosting companies on their systems. As a result, how to Check Your PHP Version? there are numerous PHP versions available online at any given time. Knowing which PHP version your web server is using is crucial if you&#8217;re adding [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6048,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[76,32],"tags":[227,230,228,229],"table_tags":[],"class_list":["post-5037","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-php","tag-check-your-php-version","tag-how-to-check-php-version-in-cpanel","tag-latest-php-version","tag-update-php-version"],"_links":{"self":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/5037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/comments?post=5037"}],"version-history":[{"count":5,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/5037\/revisions"}],"predecessor-version":[{"id":13107,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/posts\/5037\/revisions\/13107"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media\/6048"}],"wp:attachment":[{"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/media?parent=5037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/categories?post=5037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/tags?post=5037"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/arzhost.com\/blogs\/wp-json\/wp\/v2\/table_tags?post=5037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}