Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check PHP version if phpinfo() is disabled?

Tags:

php

What are some workarounds for checking what version of PHP when phpinfo() is disabled?

like image 757
Strawberry Avatar asked Sep 04 '10 22:09

Strawberry


2 Answers

  • phpversion() will return a full version string.

  • The PHP_VERSION constant also contains the version information.

  • Since PHP 5.2.7, there are also constants containing "sub-info" like PHP_MAJOR_VERSION, PHP_MINOR_VERSION....

like image 94
Pekka Avatar answered Sep 25 '22 18:09

Pekka


You can check the PHP_VERSION constant (this is a string) or PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION for their respective integer values.

like image 45
Denis 'Alpheus' Cahuk Avatar answered Sep 24 '22 18:09

Denis 'Alpheus' Cahuk