How to check the PHP license license

"Learn how to check for valid PHP license with a step-by-step example!"

Checking the PHP License

In order to check the license of a particular version of PHP, you will need to look at the source code. The source code is available for download on the official PHP website, and is the best way to determine what the license is for a given version of the software.

The license information is usually located at the top of the source code file. It will be a comment block, usually starting with the phrase "Copyright". This is followed by a list of copyright holders and the year of release for the version of PHP being used.

After the copyright holders and the year of release is the legal text of the license. This is usually a set of terms and conditions that must be followed in order to use the software. For example, in version 7.4 of PHP, the license is the PHP License, version 3.01. This is an open source license that allows for the redistribution and modification of the source code.


// This is the text of the PHP License, version 3.01

/*
 * Copyright (c) 2001-2020 The PHP Group
 *
 * This source file is subject to version 3.01 of the PHP license,     
 * that is bundled with this package in the file LICENSE, and is       
 * available through the world-wide-web at the following url:           
 * http://www.php.net/license/3_01.txt
 * If you did not receive a copy of the PHP license and are unable to  
 * obtain it through the world-wide-web, please send a note to         
 * [email protected] so we can mail you a copy immediately.              
 *
 * @category   PHP
 * @package    PHP
 * @copyright  Copyright (c) 2001-2020 The PHP Group
 * @license    http://www.php.net/license/3_01.txt  PHP License 3.01
 * @version    Release: 7.4.0
 * @link       http://www.php.net/
 */

The text of the license will provide a brief description of the terms of the license, including what is allowed and not allowed in terms of usage and distribution. It will also provide a link to the full legal text of the license, which can be found on the official PHP website.

It is important to read and understand the license before using the software. Failure to do so could lead to accidental violations of the license, which can result in legal penalties.

Answers (0)