3

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?

1 Answer 1

3

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
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for the reply, but why is 5.5? Should not be 5.4 the last version?
They are working on php 5.5 already, if you go to the PHP-5.4 branch, it will show 5.4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.