Error php Artisan serves "Failed Opening required"

Asked

Viewed 53 times

-1

PHP Warning:  require(C:\Users\Tatiana\Desktop\JME\new-jmepecas-master/vendor/autoload.php): Failed to open stream: No such file or directory in C:\Users\Tatiana\Desktop\JME\new-jmepecas-master\artisan on line 18

PHP Fatal error: Uncaught Error: Failed Opening required 'C: Users Tatiana Desktop JME new-jmepecas-master/vendor/autoload.php' (include_path='.;C: php Pear') in C: Users Tatiana Desktop JME new-jmepecas-master Artisan:18 Stack trace: #0 {main} thrown in C: Users Tatiana Desktop JME new-jmepecas-master Artisan on line 18

My Commander Json:

"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
    "php": "^8,0",
    "fideloper/proxy": "^4.4",
    "fruitcake/laravel-cors": "^2.0",
    "guzzlehttp/guzzle": "^7.0.1",
    "inertiajs/inertia-laravel": "^0.4.3",
    "laravel/framework": "^8.40",
    "laravel/jetstream": "^2.3",
    "laravel/sanctum": "^2.6",
    "laravel/tinker": "^2.5",
    "tightenco/ziggy": "^1.0"
},
"require-dev": {
    "facade/ignition": "^2.5",
    "fakerphp/faker": "^1.9.1",
    "laravel/sail": "^1.8",
    "mockery/mockery": "^1.4.2",
    "nunomaduro/collision": "^5.0",
    "phpunit/phpunit": "^9.3.3"
},
"autoload": {
    "psr-4": {
        "App\\": "app/",
        "Database\\Factories\\": "database/factories/",
        "Database\\Seeders\\": "database/seeders/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
},
"scripts": {
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover --ansi"
    ],
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate --ansi"
    ]
},
"extra": {
    "laravel": {
        "dont-discover": []
    }
},
"config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true

}

My Artisan:

   #!/usr/bin/env php
<?php

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any of our classes manually. It's great to relax.
|
*/

require __DIR__.'/vendor/autoload.php';

$app = require_once __DIR__.'/bootstrap/app.php';

/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/

$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);

$status = $kernel->handle(
    $input = new Symfony\Component\Console\Input\ArgvInput,
    new Symfony\Component\Console\Output\ConsoleOutput
);

/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/

$kernel->terminate($input, $status);

exit($status);

I’ve used Composer install, when I give < Composer require League/flysystem > answer me:

    Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires php ^8,0.8 but your php version (8.0.8) does not satisfy that requirement.
  Problem 2
    - laravel/framework is locked to version v8.52.0 and an update of this package was not requested.
    - laravel/framework v8.52.0 requires league/flysystem ^1.1 -> found league/flysystem[1.1.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.2).
  Problem 3
    - laravel/framework v8.52.0 requires league/flysystem ^1.1 -> found league/flysystem[1.1.0, ..., 1.x-dev] but it conflicts with your root composer.json require (^2.2).
    - laravel/sail v1.8.6 requires illuminate/console ^8.0|^9.0 -> satisfiable by laravel/framework[v8.52.0].
    - laravel/sail is locked to version v1.8.6 and an update of this package was not requested.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
  • What version of php is installed on your machine?

  • Minhs php version is 8.0.8

  • Already tried to run: composer install and then composer dump-autoload Sorry, I couldn’t read all the description with due attention, maybe you have already run these commands.

  • Your Composer.json has this php": "8.0" strip a , and puts . Will php": "8.0"

  • Solved, thank you

No answers

Browser other questions tagged

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