Saturday, November 16, 2024
Google search engine
HomeLanguagesCheck PHP Version Windows 11|10 Xampp, Ubuntu 20.04|22.04

Check PHP Version Windows 11|10 Xampp, Ubuntu 20.04|22.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 the PHP version in Windows 11|10 Xampp, Ubuntu 20.04|22.04; is as follows:

  • Method 1: Using the Command Line Interface
  • Method 2: Using a PHP Script
  • Method 3: Using a PHP Framework

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: Sep 2 2021 16:11:53) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies

Method 2: Using a PHP Script

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 Sep 2 2021 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: Sep 2 2021 16:11:53) ( NTS ) ...

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

RELATED ARTICLES

Most Popular

Recent Comments