What licenses are allowed in PEAR/PECL?

Answer written by Jan Lehnardt, Tomas V.V. Cox and Rasmus Lerdorf.

To make it short: Any Open Source/Free Software License. See the OSI Approved Licenses for a summary of Open Source licenses and FSF Approved Licenses. Pick one that appears on both lists. It does not need to be a GPL-compatible license from the FSF list. Here are a subset of the licenses that are on both lists: Apache License, Artistic license, BSD license, Common Public License, GPL, IBM Public License, Intel Open Source License, Jabber Open Source License, LGPL, MIT license, Mozilla Public License, PHP License, Python license, Python Software Foundation License, QPL, Sleepycat License, Sun Industry Standards Source License (SISSL), Sun Public License, W3C license, zlib/libpng license, Zope Public license.

The recomended licenses are PHP, LGPL and BSD style.

Note that for PECL extensions that are linked into PHP, the license must be compatible with the PHP license. That means you can not GPL a PECL extension or you would be violating the GPL. Note also that if you write an extension that links against a GPL'ed library you will be violating the GPL. If you need to link against a GPL'ed library, get permission from the author of the library.

To set the license of you PEAR/PECL package, put it in the head of all source code files of your package and also the type of it inside the <license> tag of your package description file (package.xml).