Error installing Slim framework

0

How to fix the error below using the composer.

composer.json code already created in bin \:

{
    "require": {
        "slim/slim": "2.*"
    }
}

    
asked by anonymous 05.06.2017 / 22:33

2 answers

1

As discussed in this question in the SOen and in this issue in the official Composer repository, the error is generated due to an incompatibility generated in Windows when the COMPOSER environment variable is defined. The practical solution is to access the environment variables and remove it, not forgetting to restart the computer after the process. This should work normally.

    
05.06.2017 / 23:57
1

Installation

Create a folder in your xampp with any name and then navigate the cmd to it:

cd c:\xampp\htdocs\NomeDaPasta

Installation with Composer

Install the composer in your project

php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"

Then in cmd yet:

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

create composer.json in the folder:

{
    "require": {
        "slim/slim": "2.*"
    }
}

After this use the command:

php composer.phar install

Create index.php:

<?php
    require 'vendor/autoload.php';
    
05.06.2017 / 22:50