Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel上传在线错误索引.php需要一次_Php_Laravel - Fatal编程技术网

Laravel上传在线错误索引.php需要一次

Laravel上传在线错误索引.php需要一次,php,laravel,Php,Laravel,大家好,我是初学者laravel程序员,我创建了一个网站,它在本地主机上运行得非常好,我将server.php改为index.php以使用根目录 但当我上传到现场时,它给了我一个错误 警告:require_once(/srv/disk11/2451785/www/hiveminds.dx.am/public/index.php):无法打开流:第22行的/srv/disk11/2451785/www/hiveminds.dx.am/index.php中没有此类文件或目录 致命错误:require_

大家好,我是初学者laravel程序员,我创建了一个网站,它在本地主机上运行得非常好,我将server.php改为index.php以使用根目录

但当我上传到现场时,它给了我一个错误

警告:require_once(/srv/disk11/2451785/www/hiveminds.dx.am/public/index.php):无法打开流:第22行的/srv/disk11/2451785/www/hiveminds.dx.am/index.php中没有此类文件或目录

致命错误:require_once():无法在第22行的/srv/disk11/2451785/www/hiveminds.dx.am/public/index.php(include_path=.:/usr/local/php-5.6.31/share/pear)中打开所需的“/srv/disk11/2451785/www/hiveminds.dx.am/index.php”)

我的本地url地址是

我的index.php文件是

    <?php

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

$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';

如果希望将
index.php
文件放在根目录中,请执行以下步骤

1。从
public/
目录中剪切
index.php
.htaccess
文件,并将其粘贴到根目录中

2。在index.php中进行一些更改,以提供如下引导文件的路径

更改前自动加载文件

require __DIR__.'/../vendor/autoload.php';
在做出改变之后

require __DIR__.'/bootstrap/autoload.php';
更改前引导应用程序文件

$app = require_once __DIR__.'/../bootstrap/app.php';
改变之后

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

现在从
http://localhost/dataform/

这是您的server.php文件。将其重命名为server.php您的index.php文件位于公共目录中。您不必更改目录。它完全可以开箱即用。@Jonjie我尝试了从public和从public文件移动到main root的两种方法,但它仍然不工作,这是我第一次尝试,我找不到解决方案。您的设置或文件/文件夹目录是否在
本地主机上工作?
?是的,它在本地主机上工作,我可以使用公用文件夹url,也可以将公用文件夹中的所有内容复制粘贴到主根目录,两者都在本地工作