Instructions on how to check the PHP version

If you are interested in adding new features on your site or trying to identify a programming error, you may have to check the PHP version that the server is currently using. Join TipsMake.com to consult the article on how to check the PHP version below!
  1. Instructions for how to use Gmail offline do not need a network
  2. Instructions on how to compile and execute Java using Command Prompt
  3. Instructions on how to create 3D effects and objects in Photoshop

If you are interested in adding new features on your site or trying to identify a programming error, you may have to check the PHP version that the server is currently using. You can check the version by running a simple PHP file on the server. Or you can check the PHP version being installed on the local computer using the Command Prompt command line interpreter application or Terminal emulator. Join TipsMake.com to consult the article on how to check the PHP version below!

Method 1: Server

1. Open the text editor or code.

Instructions on how to check the PHP version Picture 1Instructions on how to check the PHP version Picture 1

You can use Notepad or TextEdit but don't use text editing software like Microsoft Word.

2. Enter the following code.

Instructions on how to check the PHP version Picture 2Instructions on how to check the PHP version Picture 2

When running on your server, this code will return the PHP version information.

 

3. Save as PHP file.

Instructions on how to check the PHP version Picture 3Instructions on how to check the PHP version Picture 3

Click " File " → " Save as " and give the file a name. Add the .php extension to the end of the name. Choose a simple name, such as version.php.

4. Create a more detailed report (optional).

Instructions on how to check the PHP version Picture 4Instructions on how to check the PHP version Picture 4

The above file will tell you what the current version of PHP is. However, if you want more information, such as system information, release date, available commands, API information or more, you can use the phpinfo () command. Please save the file as info.php.

 

5. Upload your file (s) to the server.

Instructions on how to check the PHP version Picture 5Instructions on how to check the PHP version Picture 5

You may have to use the FTP client program or download it via the server's administrative control panel. Leave the file in the root directory on your server.

6. Open the file on your browser.

Instructions on how to check the PHP version Picture 6Instructions on how to check the PHP version Picture 6

Once the file has been uploaded to the server, you can use the browser to download them. Find the file location on the server. For example, if you leave them in the root directory of the domain, go to www.yourdomain.com/version.php .

  1. To see all the data, visit www.yourdomain.com/info.php .

Method 2: Local PHP version

1. Open Command Prompt or Terminal.

Instructions on how to check the PHP version Picture 7Instructions on how to check the PHP version Picture 7

If PHP is installed locally, you can use Command Prompt or Terminal to check the version. Besides, you can also do this if you use SSH to create a remote connection to the server via the command line.

  1. Windows - Press ⌘ Win + R and type cmd .
  2. Mac - Open the Terminal from the Utilities folder.
  3. Linux - Open Terminal from the screen or by pressing Ctrl + Alt + T

2. Enter the command to check the version of PHP.

Instructions on how to check the PHP version Picture 8Instructions on how to check the PHP version Picture 8

When running the command, the installed PHP version will be displayed.

  1. Windows, Mac, Linux - php -v

3. Fix the version number error that does not appear on Windows.

Instructions on how to check the PHP version Picture 9Instructions on how to check the PHP version Picture 9

A common problem with Windows users is that PHP is not in the system path, so the message 'php.exe' is not recognized as an internal or external command, operable program or batch file (cannot Specifies 'php.exe' as internal or external commands, executable programs or batch processing files).

  1. Find your php.exe file location. That's usually C: phpphp.exe, but you may have changed it during the installation.
  2. Type set PATH=%PATH%;C:phpphp.exe and press Enter . Change the actual position if it is not currently in this position.
  3. Rerun php -v . Now you will be able to see the version number.

Refer to some more articles:

  1. Guide the most simple and effective way to write easy-to-read code
  2. Instructions for uninstalling software on Ubuntu
  3. Instructions on how to install Ubuntu on VirtualBox virtual machine

Having fun!

5 ★ | 1 Vote