problem with installing laravel

Published 9 months ago by sasr22

Every time I try to install laravel i get the error "[RuntimeException] Could not scan for classes inside "database/seeds" which does not appear to be a file nor a folder". Does anyone know what's the problem?

Can provide more information if needed.

Best Answer (As Selected By sasr22)
ejdelmonico

Well, it seems that .env.example can't be opened and copied to .env. For now, you could just do it yourself and then you will need the app key (php artisan key:generate) which is not there because the file was not copied. It looks like some kind of permissions problem to me. Permissions are strict in how or what they allow. Inheritance is what causes most of the troubles.

Dry7
Dry7
9 months ago (151,880 XP)

@sasr22 you have a folder database/seeds?

sasr22

No, but I tried to create a folder named database and inside a folder named seeds and it didn't work too.

satish9323

did u run composer dump-autoload after creating folder ?

sasr22

@satish9323 No, I will try it now.

sasr22

@satish9323 it didnt work

nanadjei2

Why are you creating such a folder inside database? Can you show the folder structure too

sasr22

@nanadjei2 I am using the composer.json from the laravel github.

... "autoload": { "classmap": [ "database/seeds", "database/factories" ], ...

ejdelmonico

database/seeds/DatabaseSeeder.php should be there by default on a new install unless something has changed in the last 2 weeks. Make sure you have the latest composer and laravel installer on your system. Are you using Windows, if so I would narrow the search for solutions because it is OS specific.

sasr22

@ejdelmonico I have the latest composer and will make sure that I have laravel, its linux centos 6.

burlresearch

If you're missing the file from new install, then your install is incomplete for some reason. However, if you need the file, this is the stub:

$ cat database/seeds/DatabaseSeeder.php 
<?php

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // $this->call(UsersTableSeeder::class);
    }
}

of course it doesn't have to do anything, so that should be fine to define it. Then, as @satish9323 suggested, run $ composer dump-autoload and you should be OK.

sasr22

@burlresearch The file is there and is the same just like you provided, but when I run "composer dump-autoload" it gives the same error just like before: "[RuntimeException] Could not scan for classes inside "database/seeds" which does not appear to be a file nor a folder".

Jaytee
Jaytee
9 months ago (105,055 XP)

Make sure you're actually installing the whole of Laravel through composer, and not just copying the composer.json file into an empty folder.

either install through the laravel installer and then run laravel new someappname

or install directly through composer composer create-project laravel/laravel someappname

ejdelmonico

Sounds like you should look at directory permissions if everything was installed properly. The permissions on the database directory should be rwxr-xr-x or 755 and you need to be the owner of the project directory.

sasr22

@Jaytee @ejdelmonico I will try it. And another question is it possible that the problem is because I run php through chi and not cli? Every time I rum composer it says "Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI"

jlrdw
jlrdw
9 months ago (245,050 XP)

Heed warnings

Please sign in or create an account to participate in this conversation.