我一直在使用cpanel在共享主机上部署我的Laravel应用程序。但是,我得到了这个错误:
[08-Sep-2018 07:38:43 UTC] PHP Fatal error: require(): Failed opening required '/home/daankraa/public_html/../../supersax/vendor/autoload.php' (include_path='.:/opt/cpanel/ea-php71/root/usr/share/pear') in /home/daankraa/public_html/index.php on line 24
从我可以看到这里是它不想切换到根目录,但一直在寻找:
/home/daankraa/public_html/../../supersax/vendor/autoload.php in public_html.
我已经尝试了点向上移动目录,但它不想。我怎样才能解决这个问题?
提前致谢!
DA安
1)将.htaccess从公用文件夹复制到root
2)将server.php重命名为index.php
server.php文件将在root中
简单:)
将所有内容从公共目录移动到根目录,并根据以下内容修改公用文件夹的index.php文件:
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
的index.php
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <[email protected]>
*/
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
return false;
}
require_once __DIR__.'/public/index.php';