Check PHP Version Windows 11|10 Xampp, Ubuntu 22.04|20.04

Check PHP Version Windows 11|10 Xampp, Ubuntu 22.04|20.04

Check php version xampp windows, linux ubuntu, mac; In this tutorial, you will learn how to check php in Windows 11|10 Xampp, Ubuntu 20.04|22.04 and Mac using command prompt or cmd and PHP script.

PHP is a popular programming language used for web development. If you are a developer or a system administrator, it’s important to know which version of PHP is installed on your system. In this article, we’ll show you how to check the PHP version using different methods.

How to Check PHP Version in Windows 11|10 Xampp, Ubuntu 20.04|22.04 cmd/terminal

Using the following methods, you can check PHP version in Windows 11|10 Xampp, Ubuntu 20.04|22.04, and mac; are as follows:

Method 1: Using the Command Line Interface

The easiest way to check the PHP version on your system is by using the command line interface (CLI). Follow these steps:

  1. Open the command prompt (Windows) or terminal (ubuntu Linux/Mac).
  2. Type the following command and press Enter:
    • php -v
  3. The PHP version installed on your system will be displayed in the output. Example output:
    • PHP 7.4.23 (cli) (built: Jan 2 2024 16:11:53) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies

Method 2: Using a PHP Script | phpinfo.php

You can also check the PHP version by creating a PHP script and running it on your web server. Follow these steps:

  1. Create a new file named “phpinfo.php” in the document root directory of your web server.
  2. Open the file in a text editor and add the following code:
    • <?php phpinfo(); ?>
  3. Save the file and open it in a web browser. For example, if your web server is running on localhost, you can access the file by typing “http://localhost/phpinfo.php” in the browser address bar.
  4. The PHP version installed on your system will be displayed on the top of the page.
    • PHP Version 7.4.23
    • System Windows NT LAPTOP-123 10.0 build 19042 (Windows 10) AMD64
    • Build Date Jan 2 2024 16:12:01

Method 3: Using a PHP Framework

If you are using a PHP framework such as Laravel or Symfony, you can check the PHP version by running a command in the terminal. Follow these steps:

  1. Open the terminal and navigate to the root directory of your PHP project.
  2. Type the following command and press Enter:
    • php artisan --version
  3. The PHP version used by the framework will be displayed in the output.Example output (for Laravel):
    • Laravel Framework 8.55.0 PHP 7.4.23 (cli) (built: Jan 2 2024 16:11:53) ( NTS ) ...

Here is the video guide for that:

Conclusion

In this tutorial, we have shown you how to check the PHP version on your system using different methods. By knowing the PHP version, you can ensure that your web applications are compatible with the PHP version installed on your server.

Recommended PHP XAMPP & Windows Tutorials

AuthorAdmin

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *