How to check PHP version?


After shared on MySQL version, so now I will show on how to check for PHP version. Same as MySQL version, the steps are simple.

For your information, different versions of PHP may have different default settings, and in the case of newer versions might have new functions. Sometimes the website itself unable views due to the wrong version of PHP. This is the reason why you need to check on your PHP version and know what PHP version suitable for the website.

1. Using command to check(applicable in Linux server/devices)
php -V

The result would be like this
ea-php-cli Copyright 2017 cPanel, Inc.
PHP 5.6.33 (cli) (built: Jan 26 2018 04:57:00)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
 

2. Create a file

Create and put it under your website root directory for example public_html, name the file as phpinfo.php. Put the following PHP script and test it by accessing to http://yourdomain.com/phpinfo.php

The page should show as above image.

Comments