How To Know Php Version In Xampp

When working with PHP, it is essential to know the version of the PHP interpreter installed on your system. This is especially true when using XAMPP, a popular platform for developing PHP applications on Windows, macOS, and Linux systems. In this blog post, we will show you how to find the PHP version installed in your XAMPP server.

Finding PHP Version Using XAMPP Control Panel

You can find the PHP version installed in XAMPP in the XAMPP Control Panel. Here are the steps to do so:

  1. Launch the XAMPP Control Panel.
  2. Under the ‘Modules’ section, look for the ‘Apache’ module.
  3. In the ‘Apache’ module row, click on the ‘Admin’ button.
  4. A new browser window will open, displaying the XAMPP Dashboard.
  5. Under the ‘General’ section, you will find the PHP version listed as “PHP Version x.y.z” (where x.y.z is the version number).

For example, if you see “PHP Version 7.4.16” in the XAMPP Dashboard, it means that your XAMPP server is running PHP 7.4.16.

Finding PHP Version Using phpinfo()

You can also find the PHP version installed in XAMPP by using the phpinfo() function. To do this, follow these steps:

  1. Create a new PHP file (e.g., “phpinfo.php”) in your XAMPP’s htdocs folder (usually located at C:xampphtdocs on Windows or /Applications/XAMPP/xamppfiles/htdocs on macOS).
  2. Open the newly created PHP file in your favorite text editor.
  3. Add the following code to the file:
  1. Save and close the file.
  2. Start Apache server from the XAMPP Control Panel if not already running.
  3. Open your web browser and navigate to http://localhost/phpinfo.php.
  4. The PHP information page will be displayed. Look for the “PHP Version” row in the first table. The version number will be displayed as “x.y.z” (where x.y.z is the version number).

For example, if you see “PHP Version 7.4.16” in the PHP information page, it means that your XAMPP server is running PHP 7.4.16.

Conclusion

By following the steps mentioned above, you can quickly find the PHP version installed in your XAMPP server using either the XAMPP Control Panel or the phpinfo() function. Knowing the PHP version is essential to ensure compatibility with the PHP scripts and frameworks you use in your projects.

Happy coding!