Edit Article

Three Parts:Create the DocumentUnderstand the CodeExecute the Code

There are many reasons why you need to know what version of PHP your web server is running. This article will tell you how to find that, as well as much other data.

Ad

Steps

  1. 2232402 1.jpg
    1
    Open a new document in a text editor. It does not matter what kind, as long as it can save a file with the extension of ".php".
    Ad

Part 1 of 3: Create the Document

  1. 2232402 2.jpg
    1
    Inside the document, type the following code
    <?php
    phpinfo();
    ?>
    
  2. 2232402 3.jpg
    2
    Save the file as phpinfo.php

Part 2 of 3: Understand the Code

  • These tags tell the PHP engine that the content within those tags should be executed as PHP.
    <?php
    ?>
    
  • This function instructs the PHP engine to tell us about itself.
    phpinfo();
    

Part 3 of 3: Execute the Code

  1. 2232402 4.jpg
    1
    Upload the "phpinfo.php" file to the web server.
  2. 2232402 5.jpg
    2
    Visit the URL of that file in your web browser.
  3. 2232402 6.jpg
    3
    You should see an image like the one below. Near the top left side, you should see black text stating the PHP version your server is running.
    Ad

We could really use your help!

Can you tell us about
pink lemonade?
Yes
No
pink lemonade
how to make pink lemonade
Can you tell us about
haircare and styling?
Yes
No
haircare and styling
how to get thinner hair
Can you tell us about
Minecraft?
Yes
No
Minecraft
how to join a Minecraft server
Can you tell us about
digestive health?
Yes
No
digestive health
how to deal with constipation
Thanks for helping! Please tell us everything you know about
...
Tell us everything you know here. Remember, more detail is better.
Tips
Provide Details.
Please be as detailed as possible in your explanation. Don't worry about formatting! We'll take care of it. For example:
Don't say: Eat more fats.
Do say: Add fats with some nutritional value to the foods you already eat. Try olive oil, butter, avocado, and mayonnaise.

Tips

  • Instead of using phpinfo(), you can also use phpversion().

Things You'll Need

  • A text editor
  • A web server with PHP installed

Article Info

Categories: Web Programming | Answered Requests

In other languages:

Español: Cómo verificar la versión de PHP, Italiano: Come Controllare la Versione di un Server PHP, Português: Como Verificar a Versão do PHP

Thanks to all authors for creating a page that has been read 58,883 times.

Did this article help you?
Yes No

Become
an Author!

Write an Article