Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/255.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
Php 将文件夹移动到其他文件夹会导致在xampp中找不到错误页_Php_Laravel_Xampp - Fatal编程技术网

Php 将文件夹移动到其他文件夹会导致在xampp中找不到错误页

Php 将文件夹移动到其他文件夹会导致在xampp中找不到错误页,php,laravel,xampp,Php,Laravel,Xampp,我在文件夹“htdocs/webdev/example”中有一个laravel项目,我将整个“example”文件夹复制到另一个文件夹“htdocs/Webeng”,现在该示例文件夹不起作用,它显示了第一个视图,但在表单提交时显示“未找到页面”,但使用artisan serve可以提供正确的输出 showForm.blade.php <!-- showForm.blade.php --> <!DOCTYPE html> <html lang="{{ st

我在文件夹“htdocs/webdev/example”中有一个laravel项目,我将整个“example”文件夹复制到另一个文件夹“htdocs/Webeng”,现在该示例文件夹不起作用,它显示了第一个视图,但在表单提交时显示“未找到页面”,但使用artisan serve可以提供正确的输出

showForm.blade.php

<!-- showForm.blade.php -->

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Upload File</title>
    <!-- CSS only -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">        
    </head>
    <body>
        <div class="container">
            <div class="row">
                <div class="col-12">

                <br><br><br>
                    <!-- store route as action -->
                    <form action="{{route('uploads')}}" method="post" enctype="multipart/form-data">
                    @csrf
                    
                    <!-- value Part -->
                    

                    <input type="file" class="form-control" name="thing" id="title">
                    <br>
                    <input type="submit" class="btn btn-sm btn-block btn-danger" value="Upload" onclick="spinner()">
                    </form>
                    @if (session('message'))
    <h1 id="t">{{ session('message') }}</h1>
@endif
     </div>
            </div>
        </div>

    </body>
</html>

上载文件



@csrf
@if(会话('message')) {{session('message')} @恩迪夫
web.php

<?php

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    
    return view('showForm');
})->name("start");


Route::post('/uploads', function (Request $request) {
    
    if($request->file("thing")=="")
    {
        // return back()->withInput();
        return redirect()->route('start')->with('message', 'Insert Data!');
    }
    else
    {
        $name=$request->file("thing")->getClientOriginalName();
        $book=DB::table('books')->where('Title',$name)->count();
        if($book>0)
        {
        return redirect()->route('start')->with('message', 'Document already exists!');

        }
        else{

            Storage::disk("google")->putFileAs("",$request->file("thing"),$name);
            $url=Storage::disk('google')->url($name);
            $details=Storage::disk("google")->getMetadata($name);
            $path=$details['path'];
            DB::insert('insert into books (Title, Url, FileId) values (?,?,?)', [$name,$url,$path]);
            return redirect()->route('start')->with('message', 'Successfully uploaded document, you have recieved token!');
        }



    }
})->name("uploads");


showForm.blade.php中,您将表单提交到一个名为上传的路径。
但是,在路由文件中,您已将路由命名为上载


只需将routes文件中的
name(“uploads”)
更改为
name(“upload”)
,然后查看它是否正常运行

不,这只是一种类型,您清除了laravel缓存了吗<代码>php artisan缓存:清除
php artisan配置:清除
?似乎新路径中不应该有“示例”,这让我觉得它可能使用了缓存值,如果我将其复制到其他文件夹,它会工作,但不会只在一个文件夹中。是不是因为有一次我在中间取消了复印?如果这是问题所在,我该如何解决