Using the artisan function after changing the name of a public folder

As for a large number of hosts, our shared folder is called public_html. This is shared hosting, so it cannot be changed. I changed the folder publicto public_htmlto reflect this, but when I do artisan serve, it stops working. Every time I try to run it, I get:

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

If I rename the folder back to the publication, it artisan servewill start working again.

I tried after this post on laracasts , and the user in the posts published in the journal works for them, but that didn't make any difference to me. How can I change the folder and work artisan serve?

+4
source share
2

Dipesh - , // . vendor.

bootstrap/app.php :

$app->bind('path.public', function() {
    return __DIR__;
});

$app = new Illuminate\Foundation\Application(
    realpath(__DIR__ . '/../')
);

. https://laracasts.com/discuss/channels/general-discussion/where-do-you-set-public-directory-laravel-5 .

Illuminate\Foundation\Application. CLA Laravel (, php artisan), .

+4

/vendor/laravel/framework/src/Illuminate/Foundation/Application.php
:

/**
 * Get the path to the public / web directory.
 *
 * @return string
 */
public function publicPath()
{
    return $this->basePath.DIRECTORY_SEPARATOR.'public_html';
}
-1

Source: https://habr.com/ru/post/1589008/


All Articles