laravel5: chdir(): No such file or directory (errno 2)

后端 未结 9 1135
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-01 18:37

I have a problem when deploy website build on laravel 5 into VPS server, but on local machine it work fine.

My page is http://easyway.vn/ current page display blank

9条回答
  •  日久生厌
    2020-12-01 19:40

    1. Step one In vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php
    `chdir($this->laravel->publicPath());`
    
    change to 
    

    chdir('/');

    2.Step two Change these two paths in your_public_folder/index.php

    require __DIR__.'/../your_app/bootstrap/autoload.php';

    $app = require_once __DIR__.'/../your_app/bootstrap/app.php';

    3.Step three Change public path in your_app/server.php

        if ($uri !== '/' && file_exists(__DIR__.'/../public_html/'.$uri)) {
        return false;
    }
    
    require_once __DIR__.'/../public_html/index.php';
    

    Note: Change these path according to your App's new folder structure.

提交回复
热议问题