Installing and configuring the composer on my localhost

0

To use the local composer should I install it in the folder where my projects are located? In case C: / Users / Eu / Jobs ...

And as there are several projects (sites), for each one I must have composer.json right? But what about the libraries issue, for example phpmailer , in each project should I install it or just add it in the composer.json project require? This part is too confusing for me.

One more question, and when putting this project online will the library issue work or will I have to run the composer in the online environment?

    
asked by anonymous 14.10.2017 / 14:36

2 answers

0

If you are using windows and have been installed by the installer it is very likely that the composer is Global and therefore you can use in any directory of your machine, just having the file composer.json if it is linux is more likely than you have done the installation by terminal and it is easier to choose between a local or global installation in this case if you are using local installation you need to install in the root directories of each project and the server will also have to install in the root directory of the project. See in this article how to do local and global installation in linux and windows.

    
14.10.2017 / 19:15
0

The Next Tutorial (Click here to access) Responde your installation questions. each project will have its composer.json with all the libraries you use for the project. (Following the phpmailer example let's say you have 3 projects that use this library, so you will need to make phpmailer require in all 3 projects the way you prefer to use the composer, which can be composer require phpmailer/phpmailer or by adding the following line in your composer.json "phpmailer/phpmailer": "~6.0" And yes, if you want to keep the dependencies of your project always up to date and especially if you are using Composer autoload you will need to have it installed on your web server.

    
14.10.2017 / 15:58