Hosting providers are traditionally slow khổng lồ adopt new PHP versions on their servers. The consequence of this is that many different PHP versions exist on the website at the same time.Bạn sẽ xem: Apache version in xampp
If you are implementing new features, installing a new PHP-based app, or trying to locate a bug on your website, it is important to know which PHP version your web server is running.
Bạn đang xem: How to: install php 7
In this tutorial, you will learn how to check your PHP version by running PHP code on your server or using the command line.




Note: If there is more than one PHP version installed on the server, the php -v command shows the default command-line interface (CLI) version. This version is not necessarily the one that runs on the hosted websites.
Fix ‘PHP is not Recognized’ Error on Windows
On Windows, the PHP path is sometimes not recognized by the system, so the php -v command outputs the ‘php is not recognized’ error.
To solve this problem, mix the PATH environment variable first.
set PATH=%PATH%;
Conclusion
This article aimed khổng lồ explain the common ways to check the PHP version on your vps or local machine. The methods covered in this tutorial include running PHP code and using the command-line interface.
Was this article helpful?YesNoShare on TwitterShare on FacebookShare on LinkedInShare on EmailMarko AleksicMarko Aleksić is a Technical Writer at darkedeneurope.com.com. His innate curiosity regarding all things IT, combined with over a decade long background in writing, teaching & working in IT-related fields, led him to lớn technical writing, where he has an opportunity to employ his skills and make công nghệ less daunting lớn everyone.Next you should readDevOps và DevelopmentSysAdminHow lớn Install and Use PHP Composer on CentOS 7September 10, 2019Composer is an application that tracks dependencies for a project, allowing you to lớn specify a mix of...Read moreDevOps and DevelopmentWeb Servers4 Different Types of Errors in PHPAugust 6, 2019A PHP Error occurs when something is wrong in the PHP code. An error can be simple as a missing semicolon...Read moreDevOps and DevelopmentWeb ServersPHP Error Reporting: How khổng lồ Enable và Display All Errors / WarningsAugust 6, 2019If a script is not written correctly, or if something unusual happens, PHP can generate an error message....Read moreDevOps & DevelopmentSysAdminHow to Install PHP 7, 7.2 và 7.3 On CentOS 7May 24, 2019PHP is a programming language that"s often used khổng lồ automate server tasks. It"s part of the LAMP...Read moreRecent PostsCategoriesCompanyProductsConnectLive Chat ↗twitterfacebooklinkedinchevron-circle-upyoutubeinstagram