Laravel don't runs


  • | 2518 points

    Hello, am trying to run my laravel project, my even I do nothing happen.

    since I put on cmd the command: "composer install"

    it shows: "Composer could not find the config file: C:\laragon-php\bin\composer
    To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section"

    but I have composer installed with laragon...

    while in the browser, I could see these error below:

    "Warning: require(C:\laragon-php\www\apresentacaoparaentrevista\public/../vendor/autoload.php): failed to open stream: No such file or directory in C:\laragon-php\www\apresentacaoparaentrevista\public\index.php on line 24

    Fatal error: require(): Failed opening required 'C:\laragon-php\www\apresentacaoparaentrevista\public/../vendor/autoload.php' (include_path='.;C:/laragon-php/etc/php/pear') in C:\laragon-php\www\apresentacaoparaentrevista\public\index.php on line 24"

    may someone help me, please?


  • | 2518 points

    no one else helped me...


  • | 2518 points

    @leokhoa may you help me?


  • | 833 points

    laravel documentation is quite clear I think!

    https://laravel.com/docs/5.7/installation

    use :

    composer create-project --prefer-dist laravel/laravel your-app-name

    or :
    composer global require laravel/installer
    then continue with
    laravel new your-app-name


  • administrators
    | 94231 points

    @Jonathan : You can follow @kidipridi's instruction. It is the proper way to use composer.

    Or you can use "Quick app": Menu > Quick app > Laravel to create a Laravel project.


  • | 2518 points

    I did all three steps, but that was the result below:

    Creating project: [vagabunda]. Please wait...

    ***** Database:
    Created database: [vagabunda]

    ***** Hint: In Terminal, you can type:

    cd C:\laragon-wampAD\www
    composer create-project laravel/laravel vagabunda --prefer-dist

    Running.......
    Installing laravel/laravel (v5.7.0)

    • Installing laravel/laravel (v5.7.0): Loading from cache
      Created project in vagabunda

    [InvalidArgumentException]
    Composer could not find the config file: C:\laragon-php\bin\composer
    To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting S
    tarted" section

    create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

    ***** NOTE: Now, you can use pretty url for your awesome project :) *****

    (Laragon) Project path: C:/laragon-wampAD/www/vagabunda
    (Laragon) Pretty url: http://vagabunda.test

    C:\laragon-wampAD\www\vagabunda>php artisan serve

    Warning: require(C:\laragon-wampAD\www\vagabunda/vendor/autoload.php): failed to open stream: No such file or directory in C:\laragon-wampAD\www\vagabunda\artisan on line 18

    Fatal error: require(): Failed opening required 'C:\laragon-wampAD\www\vagabunda/vendor/autoload.php' (include_path='.;C:/laragon-wampAD/etc/php/pear') in C:\laragon-wampAD\www\vagabunda\artisan on line 18

    C:\laragon-wampAD\www\vagabunda>composer global require laravel/installer
    Changed current directory to C:/Users/jonat/AppData/Roaming/Composer

    [ErrorException]
    file_put_contents(C:\laragon-php\bin\composer): failed to open stream: No such file or directory

    require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

    C:\laragon-wampAD\www\vagabunda>composer create-project --prefer-dist laravel/laravel your-app-name
    Installing laravel/laravel (v5.7.0)

    • Installing laravel/laravel (v5.7.0): Loading from cache
      Created project in your-app-name

    [InvalidArgumentException]
    Composer could not find the config file: C:\laragon-php\bin\composer
    To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting S
    tarted" section

    create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

    C:\laragon-wampAD\www\vagabunda>


  • | 833 points

    i think it's your composer installation that causes it! Try uninstall it, remove it from your PATH and reinstall the composer using this link https://getcomposer.org/doc/00-intro.md#installation-windows as guide


  • | 2518 points

    but laragon already have their own composer, right?


  • | 2518 points

    it seems that my composer is getting another composer path, how may I change it?


  • administrators
    | 94231 points

    @Jonathan : You're right. I see you are working on C:\laragon-wampAD but the error said "Composer could not find the config file: C:\laragon-php\bin\composer"

    You should check your PATH to remove the C:\laragon-php\bin\composer


  • | 2518 points

    @leokhoa alright, I applied the path correction as you said.

    but, when I tried to run a laravel project it has show:

    Warning: require(C:\laragon-wampAD\www\vagabunda/vendor/autoload.php): failed to open stream: No such file or directory in C:\laragon-wampAD\www\vagabunda\artisan on line 18

    Fatal error: require(): Failed opening required 'C:\laragon-wampAD\www\vagabunda/vendor/autoload.php' (include_path='.;C:/laragon-wampAD/etc/php/pear') in C:\laragon-wampAD\www\vagabunda\artisan on line 18

    what do you recommend me to do?


  • administrators
    | 94231 points

    @Jonathan : Can you try creating a project name testproj using Menu > Quick app > Laravel?


  • | 2518 points

    @leokhoa yes, I did.

    that was the CMD's log:

    Creating project: [testproj]. Please wait...

    ***** Database:
    Created database: [testproj]

    ***** Hint: In Terminal, you can type:

    cd C:\laragon-wampAD\www
    composer create-project laravel/laravel testproj --prefer-dist

    Running.......
    Installing laravel/laravel (v5.7.13)

    • Installing laravel/laravel (v5.7.13): Downloading (100%)
      Created project in testproj

    [InvalidArgumentException]
    Composer could not find the config file: C:\laragon-wampAD\bin\composer
    To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting S
    tarted" section

    create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]

    ***** NOTE: Now, you can use pretty url for your awesome project :) *****

    (Laragon) Project path: C:/laragon-wampAD/www/testproj
    (Laragon) Pretty url: http://testproj.test

    C:\laragon-wampAD\www\testproj>

    moreover, I tried to execute the project, and the artisan console has show me this:

    C:\laragon-wampAD\www\vagabunda
    λ cd ../

    C:\laragon-wampAD\www
    λ cd testproj

    C:\laragon-wampAD\www\testproj
    λ php artisan serve

    Warning: require(C:\laragon-wampAD\www\testproj/vendor/autoload.php): failed to open stream: No such file or directory in C:\laragon-wampAD\www\testproj\artisan on line 18

    Fatal error: require(): Failed opening required 'C:\laragon-wampAD\www\testproj/vendor/autoload.php' (include_path='.;C:/laragon-wampAD/etc/php/pear') in C:\laragon-wampAD\www\testproj\artisan on line 18

    C:\laragon-wampAD\www\testproj


  • administrators
    | 94231 points

    @Jonathan : I have no idea. Maybe this link help:
    https://github.com/composer/composer/issues/1720


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.