{"id":155,"date":"2021-10-27T06:31:05","date_gmt":"2021-10-27T06:31:05","guid":{"rendered":"http:\/\/webhostingpune.co.in\/blog\/?p=155"},"modified":"2021-10-27T06:48:06","modified_gmt":"2021-10-27T06:48:06","slug":"how-to-check-the-php-version-on-linux","status":"publish","type":"post","link":"https:\/\/webhostingpune.co.in\/blog\/how-to-check-the-php-version-on-linux\/","title":{"rendered":"How to check the PHP version on Linux"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">There are several possibilities to check and validate PHP version on Linux.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">METHOD 1 <br><br>Open a bash shell terminal and use the command \u201cphp \u2013version\u201d<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2021\/10\/php.png\" alt=\"\" class=\"wp-image-156\" width=\"733\" height=\"160\" srcset=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2021\/10\/php.png 444w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2021\/10\/php-300x66.png 300w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">METHOD 2 <br><br>\u201cphp -v\u201d to get the version of PHP installed on the system<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2021\/10\/php1.png\" alt=\"\" class=\"wp-image-157\" width=\"733\" height=\"112\" srcset=\"https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2021\/10\/php1.png 451w, https:\/\/webhostingpune.co.in\/blog\/wp-content\/uploads\/2021\/10\/php1-300x46.png 300w\" sizes=\"auto, (max-width: 733px) 100vw, 733px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">METHOD 3<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s create a PHP file with content as shown below. <br>The phpinfo() function outputs a great deal of information about the state of the current PHP environment, including loaded extensions, compilation options, version, server information, and so on.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># echo \"&lt;?php phpinfo();?>\" > \/var\/www\/html\/phpinfo.php<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, considering that Apache is installed and working, open a browser and test PHP using address as follow:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;server\/phpinfo.php<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">We hope you\u2019ve found this useful!\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are several possibilities to check and validate PHP version on Linux. METHOD 1 Open a bash shell terminal and use the command \u201cphp \u2013version\u201d METHOD 2 \u201cphp -v\u201d to get the version of PHP installed on the system METHOD 3 Let\u2019s create a PHP file with content as shown below. The phpinfo() function outputs a great deal of information about the state of the current PHP environment, including loaded extensions, compilation options, version, server information, and so on. Now, considering that Apache is installed and working, open a browser and test PHP using address as follow: We hope you\u2019ve found this useful!\u00a0<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":4,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":162,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/posts\/155\/revisions\/162"}],"wp:attachment":[{"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostingpune.co.in\/blog\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}