How to know the version of PHP and other software via SSH

How to know the version of PHP and other software from the console on your VPS/dedicated server

When working with a server, you’ll often need to check the version of installed software such as PHP, MySQL, Apache, Nginx, and others. This may be required for script compatibility, environment configuration, or planning upgrades.

If you’re using a VPS or a dedicated server, you can do this by connecting via SSH.


How to check the version of common services

Once connected, run the appropriate command:

PHP:

php -v

Nginx:

nginx -v

MySQL:

mysql -V

Apache:

  • On CentOS 6, 7:
httpd -v
  • On Debian 7, 8 and Ubuntu 16, 18:
apachectl -v
Need help?Our engineers will help you free of charge with any question in minutesContact us