0

when i ran php artisan serve command in laravel root directory I encounter this error

Symfony\Component\Process\Exception\RuntimeException 

  The provided cwd "" does not exist.

  at C:\Users\legend\PhpstormProjects\pishro_last_version\vendor\symfony\process\Process.php:346
    342▕             }
    343▕         }
    344▕
    345▕         if (!is_dir($this->cwd)) {
  ➜ 346▕             throw new RuntimeException(sprintf('The provided cwd "%s" does not exist.', $this->cwd));
    347▕         }
    348▕
    349▕         $this->process = @proc_open($commandline, $descriptors, $this->processPipes->pipes, $this->cwd, $envPairs, $this->options);
    350▕

  1   C:\Users\legend\PhpstormProjects\pishro_last_version\vendor\laravel\framework\src\Illuminate\Foundation\Console\ServeCommand.php:153
      Symfony\Component\Process\Process::start(Object(Closure))

  2   C:\Users\legend\PhpstormProjects\pishro_last_version\vendor\laravel\framework\src\Illuminate\Foundation\Console\ServeCommand.php:100
      Illuminate\Foundation\Console\ServeCommand::startProcess()

I deleted the vendor and ran the composer update command again but it didn't work I also cleared all Laravel caches, but it was ineffective

Haridarshan
  • 1,898
  • 1
  • 23
  • 38

1 Answers1

0

in App\Providers\AppServiceProvider in register function I commented these lines of code and it worked

before:

    public function register()
    {
        $this->app->bind('path.public', function() {
            return realpath(base_path().'/../public_html');
        });
    }

after:

    public function register()
    {
//        $this->app->bind('path.public', function() {
//            return realpath(base_path().'/../public_html');
//        });
    }

I think the problem was that Laravel could not find the index.php file