How check PHP version?


by orpha , in category: PHP General , 8 months ago

How check PHP version?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


by shyann , a month ago


You can check your PHP version by creating a PHP file with the following code:

  echo phpinfo();

Save the file as "version.php" and place it in your web root folder. Then, open your web browser and go to "http://localhost/version.php" (assuming that your web server is running on localhost). The PHP version will be displayed at the top of the page, under the "PHP Version" section.

Alternatively, you can also check your PHP version from the command line by running the following command:

php -v

This will print out the PHP version, as well as other information about your PHP installation.