2017/10/03

Raspberry Pi - How to check whether PHP is installed and its version

This is a quick summary of how to check whether PHP is installed and its version.

1. Login to your Raspberry Pi.

2. Change the working directory to "/var/www/html".

3. Create a text file using nano or other text editor.

sudo nano version.php

4. Enter the following lines in the text editor. Use ctrl-x to save and exit when nano is used.

<?php
phpinfo();
?>

5. Open the file in your web browser, e.g. http://www.yourdomain.tld/version.php. If PHP is installed, you will be presented with info. such as the one shown below.


6. Delete the version.php file on your web server after you are done. You should be the only one seeing this information!

Reference:

php Version Check - How to Check if php is installed on the Web Server and how to Detect the php Version using phpinfo()
https://www.arclab.com/en/kb/php/how-to-check-php-installed-detect-php-version.html

No comments:

Post a Comment