Я создаю приложение, используя Laravel 5. Кэш изображений по вмешательству / изображения работал на локальном. Но на живом / реальном сервере картинка не отображается.
Вот код ошибки:
Sorry, the page you are looking for could not be found.
1/1 NotFoundHttpException in Application.php line 901:
in Application.php line 901
at Application->abort('404', '', array()) in helpers.php line 21
at abort('404') in ImageCacheController.php line 118
at ImageCacheController->getImagePath('483a2f55-b0c5-366b-a00c-2c84e01f16c3.jpg') in ImageCacheController.php line 41
at ImageCacheController->getImage('blog', '483a2f55-b0c5-366b-a00c-2c84e01f16c3.jpg') in ImageCacheController.php line 27
at ImageCacheController->getResponse('blog', '483a2f55-b0c5-366b-a00c-2c84e01f16c3.jpg')
at call_user_func_array(array(object(ImageCacheController), 'getResponse'), array('template' => 'blog', 'filename' => '483a2f55-b0c5-366b-a00c-2c84e01f16c3.jpg')) in Controller.php line 246
at Controller->callAction('getResponse', array('template' => 'blog', 'filename' => '483a2f55-b0c5-366b-a00c-2c84e01f16c3.jpg')) in ControllerDispatcher.php line 162
at ControllerDispatcher->call(object(ImageCacheController), object(Route), 'getResponse') in ControllerDispatcher.php line 107
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 108
at ControllerDispatcher->callWithinStack(object(ImageCacheController), object(Route), object(Request), 'getResponse') in ControllerDispatcher.php line 67
at ControllerDispatcher->dispatch(object(Route), object(Request), 'Intervention\Image\ImageCacheController', 'getResponse') in Route.php line 204
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 701
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Router.php line 703
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 670
at Router->dispatchToRoute(object(Request)) in Router.php line 628
at Router->dispatch(object(Request)) in Kernel.php line 214
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 141
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in VerifyCsrfToken.php line 43
at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 17
at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in ShareErrorsFromSession.php line 55
at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 61
at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 36
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 40
at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 42
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 125
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 101
at Pipeline->then(object(Closure)) in Kernel.php line 115
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 84
at Kernel->handle(object(Request)) in index.php line 53
Я использую общий hostind (бесплатно) на idhostinger, чтобы попробовать мое приложение. Пожалуйста, дайте мне ваше решение или опыт, чтобы решить это.
Проверьте драйвер образа сервера (в php_info gd или imagick)
И проверьте конфигурацию образа laravel. (Конфигурации / image.php)
Intervention Image поддерживает «GD Library» и «Imagick» для обработки изображений
внутренне. Вы можете выбрать один из них в соответствии с вашим PHP
конфигурации. По умолчанию используется реализация PHP «GD Library».
Поддерживается: «GD», «Imagick»
Я нашел решение.
конфиг / image.php
public_path('images/article')
изменить на
$_SERVER[DOCUMENT_ROOT] . '/images/article'