Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer how to specify install directory

Hi I've recently downloaded Laravel as a PHP framework, I've installed composer and have got that working, I've got it to create my project as per the Laravel website

composer create-project laravel/laravel --prefer-dist 

However when I use the above line this installs my project in the c:\users\guti directory however I want it to be installed in c:\xampp\htdocs.

I've seen another question on stackoverflow and it talks about amending the composer.json file but I'm not sure whether this is the route I should be taking as I've done a computer search for this file and this file exists as part of the laravel framework so does it make sense to amend this file?

Any composer experts on hand to point me in the right direction?

like image 732
GSG Avatar asked Oct 02 '13 13:10

GSG


People also ask

How do I install a composer in a specific directory?

Composer can be configured to install packages to a folder other than the default vendor folder by using composer/installers. Now when your theme is installed with Composer it will be placed into wp-content/themes/themename/ folder. Check the current supported types for your package.

Where does composer install packages from?

Composer is not a package manager in the same sense as Yum or Apt are. Yes, it deals with "packages" or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor ) inside your project. By default, it does not install anything globally.


2 Answers

composer create-project laravel/laravel . 

Installs in your current directory =)

like image 162
allmyshoesarewet Avatar answered Oct 05 '22 05:10

allmyshoesarewet


You should specify your destination directory where you want to create the project, from the command prompt, type cd C:\xampp\htdocs then press enter. After that, type following code on the command prompt and press enter

composer create-project laravel/laravel my-laravel-project 

Here my-laravel-project will be your project folder. The composer.json file is used to setup some configurations (for Dependency management) during installation of the package via packagist. Visit getcomposer.org for more information.

like image 29
The Alpha Avatar answered Oct 05 '22 06:10

The Alpha