Home > Net >  Fatal error: Cannot declare class Symfony\Component\HttpFoundation\Request, because the name is a
Fatal error: Cannot declare class Symfony\Component\HttpFoundation\Request, because the name is a

Time:09-02

I recently became a dev and I'm trying to work on my company's website, they told me to copy the project from their Ubuntu server via ssh, so I did, and when I ran php artisan serve I got this issue. I'm a baby regarding code so I have no idea what to do here. I checked the composer.json to see the requirements and it looks like this, I think it's a version problem so I tried to use composer update but in this project, it doesn't work, any other Laravel projects that I have work fine.

"name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "zizaco/entrust": "5.2.x-dev",
        "laravelcollective/html": "^5.2",
        "acacha/admin-lte-template-laravel": "2.*",
        "manavo/laravel-bootstrap-forms": "~0.1",
        "orangehill/iseed": "dev-master",
        "webwizo/laravel-shortcodes": "1.0.4",
        "mollie/mollie-api-php": "1.7.*",
        "doctrine/dbal": "^2.5",
        "anhskohbo/no-captcha": "^2.1"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "symfony/css-selector": "2.8.*|3.0.*",
        "symfony/dom-crawler": "2.8.*|3.0.*",
        "laravel/homestead": "^5.4"

    },
    "autoload": {
        "classmap": [
            "database",
            "app/Models"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with FilterIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16711

Deprecated: Return type of Symfony\Component\Finder\Iterator\FilterIterator::rewind() should either be compatible with FilterIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16711
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16791

Deprecated: Return type of Symfony\Component\Finder\Iterator\PathFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16791
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::getChildren() should either be compatible with RecursiveDirectoryIterator::getChildren(): RecursiveDirectoryIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16889

Deprecated: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::getChildren() should either be compatible with RecursiveDirectoryIterator::getChildren(): RecursiveDirectoryIterator, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16889
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::rewind() should either be compatible with FilesystemIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16907

Deprecated: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::rewind() should either be compatible with FilesystemIterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16907
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::current() should either be compatible with FilesystemIterator::current(): SplFileInfo|FilesystemIterator|string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16878

Deprecated: Return type of Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator::current() should either be compatible with FilesystemIterator::current(): SplFileInfo|FilesystemIterator|string, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16878
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16945

Deprecated: Return type of Symfony\Component\Finder\Iterator\FileTypeFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16945
PHP Deprecated:  Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16962

Deprecated: Return type of Symfony\Component\Finder\Iterator\FilenameFilterIterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 16962
PHP Deprecated:  Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 1550

Deprecated: Return type of Illuminate\Container\Container::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 1550
PHP Deprecated:  Return type of Illuminate\Container\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 1554

Deprecated: Return type of Illuminate\Container\Container::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 1554
PHP Deprecated:  Return type of Illuminate\Container\Container::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 1558

Deprecated: Return type of Illuminate\Container\Container::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 1558
PHP Deprecated:  Return type of Illuminate\Container\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 1567

Deprecated: Return type of Illuminate\Container\Container::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 1567
PHP Deprecated:  Return type of Illuminate\Http\Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3161

Deprecated: Return type of Illuminate\Http\Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3161
PHP Deprecated:  Return type of Illuminate\Http\Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3165

Deprecated: Return type of Illuminate\Http\Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3165
PHP Deprecated:  Return type of Illuminate\Http\Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3169

Deprecated: Return type of Illuminate\Http\Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3169
PHP Deprecated:  Return type of Illuminate\Http\Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3173

Deprecated: Return type of Illuminate\Http\Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3173
PHP Fatal error:  Cannot declare class Symfony\Component\HttpFoundation\Request, because the name is already in use in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3294

Fatal error: Cannot declare class Symfony\Component\HttpFoundation\Request, because the name is already in use in /Users/vanderpatrick/Desktop/workspace/vobyte.nl/bootstrap/cache/compiled.php on line 3294

CodePudding user response:

change the PHP version to 5.6 or 7. It will work

CodePudding user response:

in composer.json
replace line

 "php": ">=5.5.9",

with

 "php": "^5.6|^7.0",

after that run command

composer update
  • Related