Instructions on how to check the PHP version

  1. Instructions for how to use Gmail offline do not need a network
  2. Instructions on how to compile and execute Java using Command Prompt
  3. Instructions on how to create 3D effects and objects in Photoshop

If you are interested in adding new features on your site or trying to identify a programming error, you may have to check the PHP version that the server is currently using. You can check the version by running a simple PHP file on the server. Or you can check the PHP version being installed on the local computer using the Command Prompt command line interpreter application or Terminal emulator. Join TipsMake.com to consult the article on how to check the PHP version below!

Method 1: Server

1. Open the text editor or code.

Instructions on how to check the PHP version Picture 1

You can use Notepad or TextEdit but don't use text editing software like Microsoft Word.

2. Enter the following code.

Instructions on how to check the PHP version Picture 2

When running on your server, this code will return the PHP version information.

 

3. Save as PHP file.

Instructions on how to check the PHP version Picture 3

Click " File " → " Save as " and give the file a name. Add the .php extension to the end of the name. Choose a simple name, such as version.php.

4. Create a more detailed report (optional).

Instructions on how to check the PHP version Picture 4

The above file will tell you what the current version of PHP is. However, if you want more information, such as system information, release date, available commands, API information or more, you can use the phpinfo () command. Please save the file as info.php.

 

5. Upload your file (s) to the server.

Instructions on how to check the PHP version Picture 5

You may have to use the FTP client program or download it via the server's administrative control panel. Leave the file in the root directory on your server.

6. Open the file on your browser.

Instructions on how to check the PHP version Picture 6

Once the file has been uploaded to the server, you can use the browser to download them. Find the file location on the server. For example, if you leave them in the root directory of the domain, go to www.yourdomain.com/version.php .

  1. To see all the data, visit www.yourdomain.com/info.php .

Method 2: Local PHP version

1. Open Command Prompt or Terminal.

Instructions on how to check the PHP version Picture 7

If PHP is installed locally, you can use Command Prompt or Terminal to check the version. Besides, you can also do this if you use SSH to create a remote connection to the server via the command line.

  1. Windows - Press ⌘ Win + R and type cmd .
  2. Mac - Open the Terminal from the Utilities folder.
  3. Linux - Open Terminal from the screen or by pressing Ctrl + Alt + T

2. Enter the command to check the version of PHP.

Instructions on how to check the PHP version Picture 8

When running the command, the installed PHP version will be displayed.

  1. Windows, Mac, Linux - php -v

3. Fix the version number error that does not appear on Windows.

Instructions on how to check the PHP version Picture 9

A common problem with Windows users is that PHP is not in the system path, so the message 'php.exe' is not recognized as an internal or external command, operable program or batch file (cannot Specifies 'php.exe' as internal or external commands, executable programs or batch processing files).

  1. Find your php.exe file location. That's usually C: phpphp.exe, but you may have changed it during the installation.
  2. Type set PATH=%PATH%;C:phpphp.exe and press Enter . Change the actual position if it is not currently in this position.
  3. Rerun php -v . Now you will be able to see the version number.

Refer to some more articles:

  1. Guide the most simple and effective way to write easy-to-read code
  2. Instructions for uninstalling software on Ubuntu
  3. Instructions on how to install Ubuntu on VirtualBox virtual machine

Having fun!

5 ★ | 1 Vote

May be interested

  • Why should you learn PHP programming language?Photo of Why should you learn PHP programming language?
    80% of the top 10 million websites use php programming language. php is very popular for freelance work, because many small businesses or non-technical people want to use wordpress, wix or other popular content management systems to set up websites or sales websites. .
  • PHP syntaxPhoto of PHP syntax
    before starting programming in any language, the basic syntax and program structure is very important. this chapter introduces you to the basic php syntax, including: php tags, comments, print commands, echo commands, and two print and echo commands.
  • Variable in PHPPhoto of Variable in PHP
    the main way to store information in php programs is to use a variable.
  • What is PHP?Photo of What is PHP?
    php started out as a small open source project, but on the rise, more and more people find it increasingly useful.
  • Constants in PHPPhoto of Constants in PHP
    a constant is a name or an identifier for a single value. the value of the constant cannot be changed during script execution. by default, a constant is case sensitive.
  • Operator in PHPPhoto of Operator in PHP
    what is the operator? the simple answer from expression 4 + 5 is equal to 9. here, 4 and 5 are called operands and + are called operators.