Select the Gcore Platform

Gcore Edge Solutions
Go to Gcore Platform →
  • Edge Delivery (CDN)
  • DNS with failover
  • Virtual Machines
  • Bare Metal
  • Cloud Load Balancers
  • Managed Kubernetes
  • AI Infrastructure
  • Edge Security (DDOS+WAF)
  • FaaS
  • Streaming
  • Object Storage
  • ImageStack (Optimize and Resize)
  • Edge Compute (Coming soon)
Gcore Hosting
Go to Gcore Hosting →
  • VPS Hosting
  • Dedicated Servers
  • SSL Certificates


How to Check the PHP Version

PHP, one of the most commonly used programming languages for building websites and applications, is often utilized in popular Content Management Systems (CMS) like WordPress, Joomla, and ModX. Following the installation of any CMS, you might need to verify your PHP version to understand its specific functionalities. Below, we describe two ways to check your PHP version.

Please note: To check the PHP version, you’ll need server access.

Method #1: Checking PHP Version via the command line

1. Connect to your server using SSH.

2. Execute the following command:

php -v

This command should generate an output similar to:

PHP 7.3.21 (cli) (built: Aug  4 2020 11:52:37) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.21, Copyright (c) 1998-2018 Zend Technologies

The first line of the output reveals the installed PHP version, which in this case, is PHP 7.3.21.

Method #2: Checking PHP Version via a PHP File

1. Connect to your server via FTP or SSH.

2. In your server’s root directory, create a new PHP file, for instance, phpinfo.php. Inside this file, use the phpinfo() function:


3. In your web browser, navigate to https://your-server/phpinfo.php (be sure to replace “your-server” with your server’s IP address or domain name). The installed PHP version will be displayed on the first line of the resulting page.

For example, the output might show that the PHP version is 7.4.3.

Check the PHP version

Note: After verifying your PHP version, remember to delete or secure the phpinfo.php file. This file contains detailed server information and could pose a security risk if left publicly accessible.

Related learning articles

Subscribe to a useful newsletter

Favorable offers and important news once a month. No spam.