Search code examples
phpsymfony1

Cannot access image symfony 500error how to resolve?


My symfony drop 500 error because I can't acces image, but why? How can i resolve it?

This is it: http://localhost/testing/callgirl/web/images/signs-icons/bullet-list-square.png But I can find it on my localhost, but it drop 500 error because it can't...

What is the problem?

500 | Internal Server Error | ErrorException
Cannot access image.

stack trace
at ()
in SF_ROOT_DIR\apps\frontend\lib\ImageFile.class.php line 27 ...
at ImageFile->__construct('http://localhost/testing/callgirl/web/images/signs-icons/bullet-list-square.png')
in SF_ROOT_DIR\apps\frontend\lib\ImageManager.class.php line 150 ...
at ImageManager::loadStockImage('signs-icons/bullet-list-square.png')
in SF_ROOT_DIR\apps\frontend\lib\helper\ImageHelper.php line 123 ...
at stock_img_tag('signs-icons/bullet-list-square.png')
in SF_ROOT_DIR\apps\frontend\modules\userEntry\templates\signUpSuccess.php line 80 ...
at require('D:\xampplite\htdocs\testing\callgirl\apps\frontend\modules\userEntry\templates\signUpSuccess.php')
in SF_ROOT_DIR\lib\vendor\lib\view\sfPHPView.class.php line 75 ...
at sfPHPView->renderFile('D:\xampplite\htdocs\testing\callgirl\apps\frontend\modules/userEntry/templates/signUpSuccess.php')
in SF_ROOT_DIR\lib\vendor\lib\view\sfPHPView.class.php line 185 ...
at sfPHPView->render()
in SF_ROOT_DIR\lib\vendor\lib\filter\sfExecutionFilter.class.php line 155 ...
at sfExecutionFilter->executeView('userEntry', 'signUp', 'Success', array('values' => array()))
in SF_ROOT_DIR\lib\vendor\lib\filter\sfExecutionFilter.class.php line 116 ...
at sfExecutionFilter->handleView(object('sfFilterChain'), object('userEntryActions'), 'Success')
in SF_ROOT_DIR\lib\vendor\lib\filter\sfExecutionFilter.class.php line 47 ...
at sfExecutionFilter->execute(object('sfFilterChain'))
in SF_ROOT_DIR\lib\vendor\lib\filter\sfFilterChain.class.php line 53 ...
at sfFilterChain->execute()
in SF_ROOT_DIR\apps\frontend\lib\callgirlFirstViewFilter.class.php line 58 ...
at callgirlFirstViewFilter->execute(object('sfFilterChain'))
in SF_ROOT_DIR\lib\vendor\lib\filter\sfFilterChain.class.php line 53 ...
at sfFilterChain->execute()
in SF_ROOT_DIR\lib\vendor\lib\filter\sfRenderingFilter.class.php line 33 ...
at sfRenderingFilter->execute(object('sfFilterChain'))
in SF_ROOT_DIR\lib\vendor\lib\filter\sfFilterChain.class.php line 53 ...
at sfFilterChain->execute()
in SF_ROOT_DIR\lib\vendor\lib\controller\sfController.class.php line 238 ...
at sfController->forward('userEntry', 'signUp')
in SF_ROOT_DIR\lib\vendor\lib\controller\sfFrontWebController.class.php line 48 ...
at sfFrontWebController->dispatch()
in SF_ROOT_DIR\lib\vendor\lib\util\sfContext.class.php line 170 ...
at sfContext->dispatch()
in SF_ROOT_DIR\web\frontend_dev.php line 15 ...

Solution

  • Well, you know, the stacktrace is here to let you know what's going on before php send you an exception. You just need to read it carefully and you will find alone what's wrong. It's damn easy and you don't need us for that.

    Look:

    • You need to see what's around line 80 of apps\frontend\modules\userEntry\templates\signUpSuccess.php.
    • It seems that you call a function called stock_img_tag from your helper ImageManager.
    • And when you load this image using loadStockImage, it try to access the real image.
    • It seems that your class ImageFile.class.php throw an exception in its constructor when it can't find an image on your hard-drive.

    You see, I just read the stacktrace.