According to this path,
chdir(publicPath());
in vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php To change as like below :
chdir('/');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi;
Why do i get this?
The solutions I find suggest to update Kernel and server file.
Does not seem right.
php artisan serve
ErrorException : chdir(): No such file or directory (errno 2)
at /Users/***/codes/goldmembers/vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php:42
38| * @throws \Exception
39| */
40| public function handle()
41| {
> 42| chdir(public_path());
43|
44| $this->line("Laravel development server started: <http://{$this->host()}:{$this->port()}>");
45|
46| passthru($this->serverCommand(), $status);
Exception trace:
1 chdir("/Users/***/codes/goldmembers/public_html")
/Users/***/codes/goldmembers/vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php:42
2 Illuminate\Foundation\Console\ServeCommand::handle()
/Users/***/codes/goldmembers/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:32
Please or to participate in this conversation.