I have a license file for my open source project.

Where in the project's directories hierarchy should I put that file?


3 Answers 3


I agree with the other answers on the principal - it should be easy to find, although I'm not sure the examples his answer provided are are indeed the most common.

Projects created on (i.e., by) GitHub have their licenses placed in a file named LICENSE (no suffix) in the project's root directory. Another common idiom for GitHub projects is to use LICENSE.md to gain markdown formatting for it. COPYING and COPYING.md are also fairly common, although I must say that, IMHO, calling the license file "copying" misses a great deal of the point of open source - it's not about freely copying the content, it's about collaborating on it (in other words - "free as in speech, not as in beer").


It should be easy to find. I'd say in the root of your project as a license.ext or as part of the readme.ext (where .ext would of course be the appropriate extension of the format it is in). Those are the most common ways I've seen in PHP open source projects.

Of course multiple variations of the license file are seen as text file, markdown file, lower case, upper case, etc (License.txt, LICENSE.TXT, LICENSE, License.md)

Also most of the times on large scale projects the license is included in every file in the so called PHPdoc "page" section (again, this is in PHP projects).

On small scale projects, most commonly hosted on GitHub, it is included in the README.md file, which GitHub will parse and show on the project's home page.


The License is the agreement between you, and the user of the project.

The license file is just a file that defines the agreement.

It should be clear for the user what license he's getting, and what that license applies to, but there are no hard rules where to put the file, and what to name it.

For example, the Apache license advises that you put a text header in each file, which links to the Apache license online, and they don't advice putting the text of the license in your project at all, and from what I've seen, this is common practice for this license.

Some other projects don't have such a license header in their files, but just have the license file in the root of the project. Often these files are named something like license.txt, or the shouty variation LICENSE.TXT, or just license. Sometimes the license location is also included in a readme file.

The important part is that it is clear what the license applies to, and it's easy to find.

Not the answer you're looking for? Browse other questions tagged or ask your own question.