简体   繁体   中英

PHP, Composer, PHP dependency manager

I am starting a new PHP project, and I wanted to pull some php components such as "nesbot/carbon" using composer . But when I create a composer.json file and try to run composer install command, it downloads other files from my previous projects that I don's want.

Even when I try to run "composer install" with out having a composer.json file in an empty folder , it downloads some previous dependencies from caches. I didn't get that from where it's reading composer.json. Am stuck in the middle of project.

How can I create a fresh project with composer?

To create a fresh project with composer , run

$ composer init

in the root directory of that project.

For reference, see https://getcomposer.org/doc/03-cli.md#init .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM