PHP version without phpinfo() or phpversion()

Asked

Viewed 956 times

0

Does anyone know how to check the php version without using the return method? I looked at php.ini and there isn’t much useful there either. The closest I got was the version of php.exe and php-cgi.exe which is 5.2.7.7.

I can rely on executable information or this is not the real version that is installed?

Publication IIS(6 )... Is there any way to know? Googlei but I didn’t find anything useful...

  • 2

    php -v in the terminal

2 answers

1


Per command line:

php.exe --version

But beware: if you have more than one php version on the machine, the command line executable can be from one, and the one that runs on the webserver, from another.

  • Thank you very much! I went to the php installation folder and ran the command and worked perfectly.

  • I tested it on my Win7-32 machine and it generated a message saying that "CLI stopped working" (this happens with any parameter passed to php.exe). But after seeing what this guy says: http://web2.0entrepreneur.com/31/cli-has-stopped-working-on-windows-vista.html It was clear that the error was not the operating system or using "XAMP".. The problem is the PHP version... Despite the "error", php does not stop working and CLI(command line interface) does not. It seems that in version 5.2.0 and 5.2.3 this error does not happen.

1

On my computer there are two versions of PHP, as I am a WEB developer I test the versions mainly to view the performance.

The version that is configured on my IIS, I check with phpversion(); (that in the question you don’t want) in a PHP file that way:

<?php 
   phpversion();

Or by the plugin I install, which is PHP Manager (although the corresponding version to use it is IIS 7+).

By command line, same as @bfavaretto already reported, I can check inside the respective folder which version is that PHP.

Both ways are reliable and give you the expected result.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.