How to get PHP version from source code?

I am trying to create a bash script that downloads the latest version of PHP from Github (master branch) and installs it.

I would like to create a folder with a downloadable version (for example, / path / to / php / 5.4.0), but I can not find a single file from the source code saying "hey, I'm XXX version of PHP." See what my simple code does:

url="https://github.com/php/php-src/tarball/master"
curl -L $url > php-temp.tar.gz
tar -zxf php-temp.tar.gz
cd php-php-src*

I was interested in cat | grep several VERSION or README files, but I could not find links to the PHP version among them.

Does anyone know where there is a file that contains this information?

+3
source share
1 answer

The file main/php_version.hcontains the information you are looking for:

For example ( https://github.com/php/php-src/blob/master/main/php_version.h ):

/* automatically generated by configure */
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 5
#define PHP_RELEASE_VERSION 0
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "5.5.0-dev"
#define PHP_VERSION_ID 50500
+4
source

All Articles