{"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<h2 class=\"wp-block-heading\">Overview of PHP and Its Importance<\/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\"><strong>How to Check Your PHP Version<\/strong>: Methods to Determine Your PHP Version<\/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\">Run PHP Code to Verify PHP Version: Executing PHP Code<\/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\" 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>\n<\/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\"><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><\/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\"><strong>Command Line Instructions for Different Operating Systems to Check the Version of PHP<\/strong><\/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\"><strong>Correct \u201cPHP is not Recognized\u201d Mistake on Windows: Troubleshooting<\/strong><\/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\"><strong>Conclusion<\/strong><\/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],"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"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}