I recently stumbled upon composer, but I can't install it, I never used the command console. Installation off. The site does not work in any way. Help please install for OpenServer and for hosting. Can you still explain what "global installation" means? Is that what I use cmd?

  • getcomposer.org/download here download for Windows installation- download it as a program. - n.osennij
  • Work later in cmd - n.osennij
  • This is exactly how to continue working in smd with a composite and interests me - Sergey Achadovsky
  • Well, there is an instruction. The simplest thing is to go to the project folder in the explorer. In the address bar in the explorer instead of the address, write cmd. The command line will open immediately in this directory. Well or do cd handles. Well, then ... For example composer require - n.osennij
  • one
    @ sergejachadovsky you from from the Openserver work? He has a composer already installed. Open the bookmark console in Опенсервер>Меню>Дополнительно>Консоль You will see the current directory where your Openserver is installed (I have it installed in d: \ openserver). Run the composer help command and you will see the help window on the composer. If everything went exactly as I described - the composer works for you, and the maximum that you have to do is update its version with the command (if I'm not mistaken) composer update . - Edward

3 answers 3

We make sure that the PHP version is at least 5.3 , let's say it costs 5.6.

Open Advanced -> Configuration -> PHP 5.6

We are looking for the extension = php_openssl.dll string and make sure that it is not commented out (there is no semicolon before the line).

Open Extras -> Console, go to the current PHP module:

 cd modules/php/PHP-5.6/ 

Then we execute the command:

 php -r "readfile('https://getcomposer.org/installer');" | php 

If success, then in the console we see about the following:

All settings correct for using Composer Downloading 1.2.0 ... Composer successfully installed to: C: \ OpenServer \ modules \ php \ PHP-5.6 \ composer.phar Use it: php composer.phar

Check which version is the command:

 php composer.phar -V 

In response, we can get something like:

Composer version 1.2.0 2016-07-19 01:28:52

The following command creates a .bat file for short reference to Composer:

 echo @php "%~dp0composer.phar" %*>composer.bat 

Checking:

 composer -V 

If everything is in order and you see the version again, then you can continue to use just composer instead of php composer.phar composer .

    Probably the easiest way to check if a composer is installed or not is to enter the composer command, and the answer in the console will immediately become clear - if installed, you will see its logo:

      ______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ 

      Thanks to everyone, I understood a lot, I learned a lot of new and unknown things for myself. I wrote a mistake in the terminal for a long time when I entered "composer" and similar commands, then I simply edited the PATH environment variable (indicated the path to my version of php in openserver and raised up for increased priority) and then I could easily use the composer from any point. As it turned out, it was not necessary to install it at all, because of the installation, it stopped working for me, because In OpenServer already have everything.