Identify PHP Version and View Settings
Before installing a web-based PHP application on your managed server, check its compatibility with your current php setup. This guide will show you how to identify the PHP version and display the server-wide configuration settings on Linux- and Windows-based managed servers.
Please note that in order for you to be able to check the PHP version and configuration on your managed server, you need to be logged in as root user (Linux) or Administrator user (Windows) |
Identify PHP Version on Linux Server
1 |
Log in to your server via SSH as the root user.
|
2 |
Run the following command:
#php -v
The output will display the PHP version that runs on your server. |
Display PHP Server-wide Configuration Settings on Linux Server
1 |
Log in to your server via SSH as the root user.
|
2 |
Run the following command:
#php -i
The output will display all the configuration settings of the PHP that runs on your server.
NOTE: The output of the above command will be printed within your terminal session, which makes it very hard to read and examine, given its length. If you want to be able to view the configuration in a more user - friendly manner, you can run:
#php -i > phpinfo.txt
which will create a text file in your current working directory that you can examine using any text editor.
|
Identify PHP Version on Windows Server
1 |
Log in to your server via RDP with an Administrator account.
|
2 |
Navigate to the location of the php.exe file: (i. e. C:\Program Files\PHP)
|
3 |
Open Command Prompt window: ( Start -> Run -> cmd )
|
4 |
Change the working directory to the one containing the php.exe file. If the executable file is located in C:\Program Files\PHP, type:
cd C:\Program Files\PHP
|
5 |
Type:
php.exe -v
The output will display details about the version built. |
Display PHP Server-wide Configuration Settings on Windows Server
1 |
Log in to your server via RDP with an Administrator account.
|
2 |
Navigate to the location of the php.exe file: (i. e. C:\Program Files\PHP)
|
3 |
Open Command Prompt window: (Start -> Run -> cmd) |
4 |
Change the working directory to the one containing the php.exe file. If the executable file is located in C:\Program Files\PHP, type:
cd C:\Program Files\PHP |
5 |
Type:
php.exe -i
The output will display details about the version built.
NOTE: Similarly to Linux, the output provided in the Command Prompt window is very lengthy and of little use this way. In order for you to have that information in a text file which you can examine using a text editor, type:
php.exe -i > phpinfo.txt
This will create a phpinfo.txt file within your working directory containing the output from the “php.exe -i” command. |