【问题标题】:How can i fix Laravel Autoload Error in Index.php?如何修复 Index.php 中的 Laravel 自动加载错误?
【发布时间】:2020-11-09 09:39:40
【问题描述】:

[2020 年 7 月 20 日星期一 09:54:57.082115] [proxy_fcgi:error] [pid 9434:tid 140041913337600] [client 95.70.132.39:43011] AH01071: Got error 'PHP message: PHP Warning: require(/var/ www/vhosts/mydomain/httpdocs/vendor/autoload.php):无法打开流:第 24 行的 /var/www/vhosts/mydomain/httpdocs/index.php 中没有这样的文件或目录 PHP 消息:PHP 致命错误:需要(): 在 /var/www/ 中打开所需的 '/var/www/vhosts/mydomain/httpdocs/vendor/autoload.php' (include_path='.:/opt/plesk/php/7.4/share/pear') 失败vhosts/mydomain/httpdocs/index.php 第 24 行'

我在更换托管公司时遇到此错误。

我尝试了 composer install 和 composer update。

    <?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylor@laravel.com>
 */

define('LARAVEL_START', microtime(true));
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

$response->send();
$kernel->terminate($request, $response);

这也是我的 index.php 文件。

【问题讨论】:

  • 如果以前可以正常查找,删除供应商目录并运行 composer install 可能会有所帮助。
  • 没用
  • 再次检查文件权限,如果不是这样,则可能是主机上的某些内容配置错误。

标签: php laravel web laravel-5 hosting


【解决方案1】:

使用 --no-scripts 尝试 composer 命令
composer update --no-scripts

【讨论】:

    猜你喜欢
    • 2023-03-07
    • 2014-10-26
    • 2019-10-23
    • 1970-01-01
    • 2018-09-09
    • 2019-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多