Gaming industry under DDoS attack. Get DDoS protection now. Start onboarding
  1. Home
  2. Developers
  3. How to Check the PHP Version

How to Check the PHP Version

  • By Gcore
  • May 19, 2023
  • 2 min read
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 GroupZend 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:

<?phpphpinfo();?>

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.

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.

Conclusion

Developing with PHP and need an efficient cloud solution? Gcore’s offerings have you covered.

  • Web Application Security enhances the security of your PHP applications by protecting them from web-based threats, ensuring a secure experience for your website’s visitors.
  • Managed Database for PostgreSQL provides a hassle-free database management solution, making it easier to handle data-driven operations in your PHP applications.
  • Virtual Instances.
  • Bare Metal offers the ultimate in server power and performance with an entire server dedicated to your needs alone.

Start coding with PHP on Gcore today

Related articles

What's the difference between multi-cloud and hybrid cloud?

Multi-cloud and hybrid cloud represent two distinct approaches to distributed computing architecture that build upon the foundation of cloud computing to help organizations improve their IT infrastructure.Multi-cloud environments involve us

What is multi-cloud? Strategy, benefits, and best practices

Multi-cloud is a cloud usage model where an organization utilizes public cloud services from two or more cloud service providers, often combining public, private, and hybrid clouds, as well as different service models, such as Infrastructur

What is cloud migration? Benefits, strategy, and best practices

Cloud migration is the process of transferring digital assets, such as data, applications, and IT resources, from on-premises data centers to cloud platforms, including public, private, hybrid, or multi-cloud environments. Organizations can

What is a private cloud? Benefits, use cases, and implementation

A private cloud is a cloud computing environment dedicated exclusively to a single organization, providing a single-tenant infrastructure that improves security, control, and customization compared to public clouds.Private cloud environment

What is a cloud GPU? Definition, types, and benefits

A cloud GPU is a remotely rented graphics processing unit hosted in a cloud provider's data center, accessible over the internet via APIs or virtual machines. These virtualized resources allow users to access powerful computing capabilities

What is cloud networking: benefits, components, and implementation strategies

Cloud networking is the use and management of network resources, including hardware and software, hosted on public or private cloud infrastructures rather than on-premises equipment. Over 90% of enterprises are expected to adopt cloud netwo

Subscribe to our newsletter

Get the latest industry trends, exclusive insights, and Gcore updates delivered straight to your inbox.