Laravel-filemanager: PLEASE HELP Sorry, the page you are looking for could not be found.

Created on 10 Oct 2016  路  20Comments  路  Source: UniSharp/laravel-filemanager

This plugin works on my local computer but when i moved it to the server, i get Sorry, the page you are looking for could not be found.

This is my route below
MYDOMAINNAME.COM/laravel-filemanager?type=Images&CKEditor=editor1&CKEditorFuncNum=1&langCode=en

NotFoundHttpException in RouteCollection.php line 161:
in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 821
at Router->findRoute(object(Request)) in Router.php line 691
at Router->dispatchToRoute(object(Request)) in Router.php line 675
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 136
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 53

All 20 comments

Does your domain point to the public directory?

no it does not. how do i make it point to my public directory. right now i copied all the files from my public folder to the root. i think the problem lies here

        filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
        filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
        filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
        filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'

Laravel applications require that the web root directory be set to the app/public directory ... Many shared hostings don't allow you to do that... You need access to your web server configuration ...

Where are you hosted?

www.namecheap.com. Is there no way i can manipulate the ckeditor to point to the public directory if my hosting may proof difficult?

laravel on my shared hosting has been working fine all along. i have been able to manipulate so many tins to make it work. I am only having difficulties in ckeditor

Leanweb please help?My hosting has helped me set it to myapplication/public directiory. Please its still now working

@maxteebabs Did you add service provider in config/app.php?
See here.

@g0110280 yes I have done all of that. The filemanager works on my computer locally. I have verified the settings on the server but anytime i click on send to the server i get the error. My webroot points to my public directory. where can I find this routes?
filebrowserImageBrowseUrl: '/laravel-filemanager?type=Images',
filebrowserImageUploadUrl: '/laravel-filemanager/upload?type=Images&_token={{csrf_token()}}',
filebrowserBrowseUrl: '/laravel-filemanager?type=Files',
filebrowserUploadUrl: '/laravel-filemanager/upload?type=Files&_token={{csrf_token()}}'
the routes to the laravel-filemanager? maybe i can troubleshoot it from there.

@g0110280 Please can you send me your email? I want to give you access to my cpanel login to help me fix this issue. Thanks

somehow i noticed Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class, does not override the register method in the serviceprovider class when it runs on my server.

i did a var_dump(); here
$this->app['laravel-filemanager'] = $this->app->share(function ()
{
return true;
});
It doesnt get to this line of code on the server. So I guess thats the reason I am getting the error.

It is trying to use app/http/routes.php to route '/laravel-filemanager?type=Images' on the server.

Aleast I have been able to narrow down my problem. I will appreciate if any body can help me
@leanweb @g0110280 @youchenlee @FreedomKnight @twpaddy

i guess the only work around here it to use my normal route to route /laravel-manager/ to the lfmcontroller unfortunately I am still new to laravel

I had the same issue on my localhost. It solved by adding 'web' to middlewares in config file

For laravel 5.2 and laravel 5.3, please set 'middlewares' => ['web', 'auth'], in config/lfm.php

@VictorZZZZ I was able to get it working. In my cpanel, I had to enable all modules. I do not know which of the modules it needed to run.

Hello maxteebabs! how did you get it working on the local?
I'm facing the same problem in local. I've the copied the laravel-filemanager under unisharp folder in public directory. But it is throwing NotFoundHttpException in RouteCollection.php. Please! help me

This is my config file so you can just verify with yours
step1: add the service provider in config/app
Unisharp\Laravelfilemanager\LaravelFilemanagerServiceProvider::class,
step2: check config/lfm.php and validate with yours
`

return [
// If true, the uploaded file will be renamed to uniqid() + file extension.
'rename_file' => true,

// If rename_file set to false and this set to true, then non-alphanumeric characters in filename will be replaced.
'alphanumeric_filename' => true,
// If true, non-alphanumeric folder name will not be allowed.
'alphanumeric_directory' => false,

'use_package_routes'    => true,

// For laravel 5.2, please set to ['web', 'auth']
'middlewares'           => ['web', 'auth'],

// Add prefix for routes
'prefix'           => 'laravel-filemanager',

// Allow multi_user mode or not.
// If true, laravel-filemanager create private folders for each signed-in user.
'allow_multi_user'      => true,

// The database field to identify a user.
// When set to 'id', the private folder will be named as the user id.
// NOTE: make sure to use an unique field.
'user_field'            => 'id',

'shared_folder_name'    => 'shares',
'thumb_folder_name'     => 'thumbs',

'images_dir'            => 'public/photos/',
'images_url'            => '/photos/',

'files_dir'             => 'public/files/',
'files_url'             => '/files/',

// available since v1.3.0
'valid_image_mimetypes' => [
    'image/jpeg',
    'image/pjpeg',
    'image/png',
    'image/gif'
],

// available since v1.3.0
// only when '/laravel-filemanager?type=Files'
'valid_file_mimetypes' => [
    'image/jpeg',
    'image/pjpeg',
    'image/png',
    'image/gif',
    'application/pdf',
    'text/plain',
],

// file extensions array, only for showing file information, it won't affect the upload process.
'file_type_array'         => [
    'pdf'  => 'Adobe Acrobat',
    'doc'  => 'Microsoft Word',
    'docx' => 'Microsoft Word',
    'xls'  => 'Microsoft Excel',
    'xlsx' => 'Microsoft Excel',
    'zip'  => 'Archive',
    'gif'  => 'GIF Image',
    'jpg'  => 'JPEG Image',
    'jpeg' => 'JPEG Image',
    'png'  => 'PNG Image',
    'ppt'  => 'Microsoft PowerPoint',
    'pptx' => 'Microsoft PowerPoint',
],

// file extensions array, only for showing icons, it won't affect the upload process.
'file_icon_array'         => [
    'pdf'  => 'fa-file-pdf-o',
    'doc'  => 'fa-file-word-o',
    'docx' => 'fa-file-word-o',
    'xls'  => 'fa-file-excel-o',
    'xlsx' => 'fa-file-excel-o',
    'zip'  => 'fa-file-archive-o',
    'gif'  => 'fa-file-image-o',
    'jpg'  => 'fa-file-image-o',
    'jpeg' => 'fa-file-image-o',
    'png'  => 'fa-file-image-o',
    'ppt'  => 'fa-file-powerpoint-o',
    'pptx' => 'fa-file-powerpoint-o',
],

];

`
//pay close attention to line 15 and line 32 to 36

step3: if you are using this on a shared hosting, make sure you have all php module enabled

I have the same issue in my local. how do i solve this ?

@ishraqe try php artisan route:clear.

php artisan config:clear
php artisan cache:clear
composer dump-autoload

this helped me solve the issue

(1/1)聽NotFoundHttpException

in聽RouteCollection.php聽(line 179)
at聽RouteCollection->match(object(Request))in聽Router.php聽(line 546)
at聽Router->findRoute(object(Request))in聽Router.php聽(line 525)
at聽Router->dispatchToRoute(object(Request))in聽Router.php聽(line 511)
at聽Router->dispatch(object(Request))in聽Kernel.php聽(line 176)
at聽Kernel->Illuminate\Foundation\Http{closure}(object(Request))in聽Pipeline.php聽(line 30)
at聽Pipeline->Illuminate\Routing{closure}(object(Request))in聽TransformsRequest.php聽(line 30)
at聽TransformsRequest->handle(object(Request),聽object(Closure))in聽Pipeline.php聽(line 148)
at聽Pipeline->Illuminate\Pipeline{closure}(object(Request))in聽Pipeline.php聽(line 53)
at聽Pipeline->Illuminate\Routing{closure}(object(Request))in聽ValidatePostSize.php聽(line 27)
at聽ValidatePostSize->handle(object(Request),聽object(Closure))in聽Pipeline.php聽(line 148)
at聽Pipeline->Illuminate\Pipeline{closure}(object(Request))in聽Pipeline.php聽(line 53)
at聽Pipeline->Illuminate\Routing{closure}(object(Request))in聽CheckForMaintenanceMode.php聽(line 46)
at聽CheckForMaintenanceMode->handle(object(Request),聽object(Closure))in聽Pipeline.php聽(line 148)
at聽Pipeline->Illuminate\Pipeline{closure}(object(Request))in聽Pipeline.php聽(line 53)
at聽Pipeline->Illuminate\Routing{closure}(object(Request))in聽Pipeline.php聽(line 102)
at聽Pipeline->then(object(Closure))in聽Kernel.php聽(line 151)
at聽Kernel->sendRequestThroughRouter(object(Request))in聽Kernel.php聽(line 116)
at聽Kernel->handle(object(Request))in聽index.php聽(line 53)
at聽require_once('C:\xampp\htdocs\t\public\index.php')in聽index.php聽(line 21)

(1/1)聽NotFoundHttpException

in聽RouteCollection.php聽(line 179)
at聽RouteCollection->match(object(Request))in聽Router.php聽(line 546)
at聽Router->findRoute(object(Request))in聽Router.php聽(line 525)
at聽Router->dispatchToRoute(object(Request))in聽Router.php聽(line 511)
at聽Router->dispatch(object(Request))in聽Kernel.php聽(line 176)
at聽Kernel->Illuminate\Foundation\Http{closure}(object(Request))in聽Pipeline.php聽(line 30)
at聽Pipeline->Illuminate\Routing{closure}(object(Request))in聽TransformsRequest.php聽(line 30)
at聽TransformsRequest->handle(object(Request),聽object(Closure))in聽Pipeline.php聽(line 148)
at聽Pipeline->Illuminate\Pipeline{closure}(object(Request))in聽Pipeline.php聽(line 53)
at聽Pipeline->Illuminate\Routing{closure}(object(Request))in聽ValidatePostSize.php聽(line 27)
at聽ValidatePostSize->handle(object(Request),聽object(Closure))in聽Pipeline.php聽(line 148)
at聽Pipeline->Illuminate\Pipeline{closure}(object(Request))in聽Pipeline.php聽(line 53)
at聽Pipeline->Illuminate\Routing{closure}(object(Request))in聽CheckForMaintenanceMode.php聽(line 46)
at聽CheckForMaintenanceMode->handle(object(Request),聽object(Closure))in聽Pipeline.php聽(line 148)
at聽Pipeline->Illuminate\Pipeline{closure}(object(Request))in聽Pipeline.php聽(line 53)
at聽Pipeline->Illuminate\Routing{closure}(object(Request))in聽Pipeline.php聽(line 102)
at聽Pipeline->then(object(Closure))in聽Kernel.php聽(line 151)
at聽Kernel->sendRequestThroughRouter(object(Request))in聽Kernel.php聽(line 116)
at聽Kernel->handle(object(Request))in聽index.php聽(line 53)
at聽require_once('C:xampp\htdocs\tpublicindex.php')in聽index.php聽(line 21)

What are you trying to do? i cant see the full error from your post

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dzhangar1980 picture Dzhangar1980  路  4Comments

rlrlaa123 picture rlrlaa123  路  3Comments

sajjad-talebi picture sajjad-talebi  路  3Comments

ikkosatrio picture ikkosatrio  路  4Comments

phamtien9819 picture phamtien9819  路  5Comments