Error installing Slim framework

Asked

Viewed 298 times

0

How to fix the error below by using Composer.

Code of Composer.json already created in bin folder\ :

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

Erro

  • According to this question, You may need to delete the environment variable for Composer.

  • @Andersoncarloswoss did not resolve...Composer continues to display this message!

  • Composer could not find the config file: C: Programdata Composersetup bin To initialize a project, Please create a Composer.json file as described in the https://getcomposer.org/ "Getting Started" Section

  • Inside that briefcase bin you created this file?

  • Correto bin/Composer.json -> { "require": { "slim/slim": "2. *" } }

  • I executed the command from the composer overall and worked perfectly. Nor did it need any file composer.json, since it is using the create-project. Try to rotate the command with the composer globally installed or place the archive composer.json at the root where you will create the project.

  • php Composer.phar installs this command ???

  • But you are doing install or create-project?

  • php Composer.phar install inside app1/ containing the Composer.json

Show 5 more comments

2 answers

1

Installation

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

cd c:\xampp\htdocs\NomeDaPasta

Installation with Composer

Install Composer in your project

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

then in cmd still:

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

create Composer.json in the folder:

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

then use the command:

php composer.phar install

Create the index.php:

<?php
    require 'vendor/autoload.php';
  • The same error: Composer could not find the config file: C: Programdata Composersetup bin To initialize a project, Please create a Composer.json file as described in the https://getcomposer.org/ "Getting Started" Section

  • Here it was normal: http://imgur.com/a/aFqgQ

  • myComposer.json in bin/ { "require": { "slim/slim": "2. *" } }

  • the proxy disrupts ???

  • Sometimes

  • if my json ...is not wrong.. it can only be the proxy or firewall

  • The commands you used the same as the ones I passed?

  • Right. All the same!!!

  • What version of your Composer?

  • Composer version 1.4.2 2017-05-17 08:17:52

  • Give a Composer update and see if you create the Composer.lock file

  • Composer update Composer could not find the config file: C: Programdata Composersetup bin To initialize a project, Please create a Composer.json file as described in the https://getcomposer.org/ "Getting Started" Section

  • Composer could not find the config file: C: Programdata Composersetup bin that you have a COMPOSER environment variable set and configured for C: Programdata Composersetup bin. You must deselect / delete this env var.

  • can correct...thank you

Show 9 more comments

1


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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.