1

I got access to a php server on which an instance of Laravel is running. downloaded the entire folder and I now try to run the code base on my laptop. Running php artisan serve gives me an error saying:

[ErrorException]
chdir(): No such file or directory (errno 2)

This SO answer says that the public folder cannot be found, and indeed, there is no `public folder. But I have no idea how it can then function on the server it is running on.

Does anybody know what I can do to get this running? All tips are welcome!

Community
  • 1
  • 1
kramer65
  • 50,427
  • 120
  • 308
  • 488
  • I think the answer you linked to is incorrect. It gives an answer to a question about Flask and JSON, nothing to do with Laravel. – Sherif Sep 09 '16 at 15:00
  • The "public" folder is the www ot htdocs equivalent on the server, so you couldn't download it... look a the original Laravel configuration – Kyobul Sep 09 '16 at 15:00
  • Did you look at the `config/filesystems.php` file? Particularly the disks => public array? – Denis Priebe Sep 09 '16 at 15:28
  • Always look for web server's config first.. always. That will tell you what it tries to use as `DocumentRoot` (Apache, which I hope you are NOT using) or `root` (nginx, which you should be using). – N.B. Sep 09 '16 at 17:52

1 Answers1

2

Generally speaking, the public directory need not be in the same directory as that of your laravel installation. It only serves as the document root for your webserver. As such it can be moved elsewhere (although there's no pragmatic reason for this) on your filesystem.

Sherif
  • 11,786
  • 3
  • 32
  • 57