Learn how to obtain a list in JSON format that contains all of the PHP releases from the official PHP website.

While working on a personal project where I should allow users to select a specific version to run some code, I wondered if there was any existent list with all the major and minor releases from PHP. Thanks to an interesting project namely PHPBrew, I noticed that they obtained the versions of PHP from the official PHP website.

You can obtain a list in JSON format with all the releases of each PHP version from the following URL:

  • Where you only need to replace PHP_VERSION with the major release that you're looking for e.g. 4, 5, 7, or 8.
https://www.php.net/releases/index.php?json=1&version=PHP_VERSION&max=1000

PHP 8

https://www.php.net/releases/index.php?json=1&version=8&max=1000

PHP 7

https://www.php.net/releases/index.php?json=1&version=7&max=1000

PHP 5

https://www.php.net/releases/index.php?json=1&version=5&max=1000

PHP 4

https://www.php.net/releases/index.php?json=1&version=4&max=1000

Example of PHP 5

To get the list of all the available releases of PHP 5, you can trigger a request to the following URL:

https://www.php.net/releases/index.php?json=1&version=5&max=1000

Where the response for each version will have the following structure:

  • version
    • announcement
    • source
    • date
    • museum

Which looks like this in JSON format:

{
  "5.6.40": {
    "announcement": {
      "English": "/releases/5_6_40.php"
    },
    "source": [
      {
        "filename": "php-5.6.40.tar.bz2",
        "name": "PHP 5.6.40 (tar.bz2)",
        "sha256": "ffd025d34623553ab2f7fd8fb21d0c9e6f9fa30dc565ca03a1d7b763023fba00",
        "date": "10 Jan 2019"
      },
      {
        "filename": "php-5.6.40.tar.gz",
        "name": "PHP 5.6.40 (tar.gz)",
        "sha256": "56fb9878d12fdd921f6a0897e919f4e980d930160e154cbde2cc6d9206a27cac",
        "date": "10 Jan 2019"
      },
      {
        "filename": "php-5.6.40.tar.xz",
        "name": "PHP 5.6.40 (tar.xz)",
        "sha256": "1369a51eee3995d7fbd1c5342e5cc917760e276d561595b6052b21ace2656d1c",
        "date": "10 Jan 2019"
      }
    ],
    "date": "10 Jan 2019",
    "museum": false
  },
  "5.6.39": {
    "announcement": {
      "English": "/releases/5_6_39.php"
    },
    "source": [
      {
        "filename": "php-5.6.39.tar.bz2",
        "name": "PHP 5.6.39 (tar.bz2)",
        "sha256": "b3db2345f50c010b01fe041b4e0f66c5aa28eb325135136f153e18da01583ad5",
        "date": "06 Dec 2018"
      },
      {
        "filename": "php-5.6.39.tar.gz",
        "name": "PHP 5.6.39 (tar.gz)",
        "sha256": "127b122b7d6c7f3c211c0ffa554979370c3131196137404a51a391d8e2e9c7bb",
        "date": "06 Dec 2018"
      },
      {
        "filename": "php-5.6.39.tar.xz",
        "name": "PHP 5.6.39 (tar.xz)",
        "sha256": "8147576001a832ff3d03cb2980caa2d6b584a10624f87ac459fcd3948c6e4a10",
        "date": "06 Dec 2018"
      }
    ],
    "date": "06 Dec 2018",
    "museum": false
  },
  "5.6.38": {
    "announcement": {
      "English": "/releases/5_6_38.php"
    },
    "source": [
      {
        "filename": "php-5.6.38.tar.bz2",
        "name": "PHP 5.6.38 (tar.bz2)",
        "sha256": "d65b231bbdd63be4439ef5ced965cfd63e62983429dbd4dfcfb49981593ebc03",
        "date": "13 Sep 2018"
      },
      {
        "filename": "php-5.6.38.tar.gz",
        "name": "PHP 5.6.38 (tar.gz)",
        "sha256": "3b74d46cd79a45cce90c8059e09d8bd0beeb5de562cbb0cb42f96ff8fa665fd4",
        "date": "13 Sep 2018"
      },
      {
        "filename": "php-5.6.38.tar.xz",
        "name": "PHP 5.6.38 (tar.xz)",
        "sha256": "c2fac47dc6316bd230f0ea91d8a5498af122fb6a3eb43f796c9ea5f59b04aa1e",
        "date": "13 Sep 2018"
      }
    ],
    "date": "13 Sep 2018",
    "museum": false
  },
  "5.6.37": {
    "announcement": {
      "English": "/releases/5_6_37.php"
    },
    "source": [
      {
        "filename": "php-5.6.37.tar.bz2",
        "name": "PHP 5.6.37 (tar.bz2)",
        "sha256": "886ad63d05d94ea3e54322691aadea0cf1d4bcdb4450b02fe300e5b570788b23",
        "date": "19 Jul 2018"
      },
      {
        "filename": "php-5.6.37.tar.gz",
        "name": "PHP 5.6.37 (tar.gz)",
        "sha256": "b7ec077f35ef3a8cdd33c29124140b1761111a1429878b4c463bb20d2a31b184",
        "date": "19 Jul 2018"
      },
      {
        "filename": "php-5.6.37.tar.xz",
        "name": "PHP 5.6.37 (tar.xz)",
        "sha256": "5000d82610f9134aaedef28854ec3591f68dedf26a17b8935727dac2843bd256",
        "date": "19 Jul 2018"
      }
    ],
    "date": "19 Jul 2018",
    "museum": false
  },
  "5.6.36": {
    "announcement": {
      "English": "/releases/5_6_36.php"
    },
    "source": [
      {
        "filename": "php-5.6.36.tar.bz2",
        "name": "PHP 5.6.36 (tar.bz2)",
        "sha256": "626a0e3f5d8a0e686a2b930f0dd3a0601fe3dcb5e43dd0e8c3fab631e64e172a",
        "date": "26 Apr 2018"
      },
      {
        "filename": "php-5.6.36.tar.gz",
        "name": "PHP 5.6.36 (tar.gz)",
        "sha256": "06086a8b6a9964ef8009c4d9176b4eeb0c564ea39c1213f015e24f3466d2d69f",
        "date": "26 Apr 2018"
      },
      {
        "filename": "php-5.6.36.tar.xz",
        "name": "PHP 5.6.36 (tar.xz)",
        "sha256": "18f536bf548e909b4e980379d0c4e56d024b2b1eb1c9768fd169360491f1d6dd",
        "date": "26 Apr 2018"
      }
    ],
    "date": "26 Apr 2018",
    "museum": false
  }
}

Happy coding ❤️!


Sponsors