【问题标题】:I have a laravel5 project downloaded from the cpanel but it's not working我从 cpanel 下载了一个 laravel5 项目,但它不工作
【发布时间】:2023-03-24 18:06:01
【问题描述】:

我已将项目文件添加到我的 mac 中的 htdocs 文件并导出数据库,composer install 工作正常,php artisan-migrate 给我一个重复数据库和表的错误..但是当我运行 php artisan serve它给了我错误,不会在 localhost:8000 上运行 这是我得到的错误

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

【问题讨论】:

标签: php laravel cpanel


【解决方案1】:

这通常是因为 Laravel 找不到您的公用文件夹。

建议here 的一个解决方案是更改此行:

chdir($this->laravel->publicPath());

vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php 中:

chdir('/');

看看这是否适合你。

【讨论】:

    【解决方案2】:

    清空数据库,然后运行 ​​php artisan migrate。然后使用

    发球错误:

    这意味着你的 Laravel 应用程序找不到公用文件夹。

    改变

    chdir($this->laravel->publicPath());
    

    在 vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php 中:

    chdir('/');
    

    【讨论】:

    • php artisan migrate 现在给我新的错误 -_- “[Illuminate\Database\QueryException] SQLSTATE[42S01]:基表或视图已经存在:1050 表“会话”已经存在(SQL:创建表 sessions (id varchar(255) not null, p ayload text not null, last_activity int not null, user_id int unsigned null) 默认字符集 utf8 collat​​e utf8_unicode_ci) "和我的另一个错误将在下一条评论中发布
    • 这里是另一个错误“ [PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'sessions' a lready exists”
    • 我可以私下联系你吗?
    • 是的。您需要清空所有表,然后运行迁移
    • 我做了 .. 并得到了这个错误 -_- [Illuminate\Database\QueryException] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'justnew.settings' 不存在( SQL: select * from settings where settings.id = 1 limit 1)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-10
    • 2017-07-25
    • 1970-01-01
    • 2018-09-23
    相关资源
    最近更新 更多