I'm trying to create a bash script which downloads the latest version of PHP from Github (master branch) and install it.
I would like to create a folder with the version I'm downloading (e. g. /path/to/php/5.4.0) but I cannot find any file among the source code saying "hey, I am the XXX version of PHP". Look below 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 wondering to cat|grep some VERSION or README file but I could not find any references to PHP version among them.
Does someone knows where there is a file which this information?
The file main/php_version.h has 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With