Get started with 33% off your first certification using code: 33OFFNEW

5 Composer commands you might not know

3 min read
Published on 1st July 2024

Composer is an essential tool for PHP developers, primarily known for its ability to manage dependencies in PHP projects. While most developers are familiar with basic commands like install and update, Composer has several powerful features that can significantly enhance your development workflow. In this article, we’ll explore five Composer commands you might not know about, helping you to become more efficient and effective in managing your PHP projects.

1. composer outdated

The composer outdated command is a handy way to check which of your dependencies have newer versions available. This is particularly useful for keeping your project up-to-date and ensuring you’re not missing out on important updates or security patches.


To use this command, simply run:

composer outdated

This command will list all the packages that have updates available. If you want more detailed information, you can use the --direct option to see only the packages listed in your composer.json.

composer outdated --direct

For more information, you can refer to the official Composer documentation on outdated.

2. composer show

The composer show command provides detailed information about the installed packages. It can be used to list all installed packages or to get information about a specific package.


To list all installed packages, run:

composer show

To get detailed information about a specific package, pass the package name as an argument:

composer show vendor/package

This command is useful for quickly checking the version and dependencies of a package. You can also see which packages are direct dependencies and which ones are transitive.

Check out the Composer documentation on show for more details.

3. composer check-platform-reqs

The composer check-platform-reqs command checks if your PHP environment meets the platform requirements specified by your dependencies. This command ensures that your PHP version and installed extensions are compatible with the packages you’re using.


Run the command:

composer check-platform-reqs

This will output any platform requirement issues, helping you to diagnose compatibility problems early in the development process.

Learn more from the official documentation.

4. composer licenses

The composer licenses command provides a quick overview of the licenses of the installed packages. This is particularly useful for ensuring that your project complies with open-source licenses and for auditing third-party packages.


To see the licenses of all installed packages, run:

composer licenses

This command will display the package name, version, and license type, allowing you to easily review the licensing of your dependencies.

For more details, see the Composer documentation on licenses.

5. composer fund

The composer fund command shows information about the funding of the installed packages. This is useful for developers who want to support the open-source projects they depend on.


Run the command:

composer fund

This will display URLs where you can support the development of the packages you use. Supporting these projects helps maintainers to continue their work and improve the tools you rely on.

Refer to the Composer documentation on fund for more information.

Summing up

While the basic Composer commands are indispensable for managing dependencies, these lesser-known commands can provide additional insights and control over your PHP projects. By incorporating these commands into your workflow, you can ensure your projects are up-to-date, compliant with licensing requirements, and compatible with your development environment.

Exploring and utilizing the full range of Composer commands will make you a more effective and informed developer, helping you to maintain high-quality PHP projects. For a complete list of Composer commands and their usage, visit the official Composer documentation.