Symfony 2.6 «Обработчик исключений должен быть допустимым вызываемым PHP».

0

Я не совсем уверен, что здесь не так, или как заставить его работать. Я попытался удалить мои файлы symfony от поставщика /symfony, переустановить их из компоновщика и очистить свой кеш много раз.

Кто-нибудь есть идеи о том, что может вызвать это?

CRITICAL - Uncaught PHP Exception LogicException: "The exception handler must be a valid PHP callable." at /var/www/html/allTheKisses/vendor/symfony/symfony/src/Symfony/Component/Debug/ExceptionHandler.php line 74 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke". 
DEBUG - Notified event "kernel.request" to listener "Symfony\Component\EventDispatcher\Debug\WrappedListener::__invoke". 
DEBUG - Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Acme\DemoBundle\EventListener\ControllerListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::onKernelController". 
DEBUG - Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". 

Мой config.yaml выглядит следующим образом

imports:
    - { resource: parameters.yml }
    - { resource: security.yml }

framework:
    #esi:             ~
    #translator:      { fallback: "%locale%" }
    secret:          "%secret%"
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
    form:            ~
    csrf_protection: ~
    validation:      { enable_annotations: true }
    templating:
        engines: ['twig']
        #assets_version: SomeVersionScheme
    default_locale:  "%locale%"
    trusted_hosts:   ~
    trusted_proxies: ~
    session:
        # handler_id set to null will use default session handler from php.ini
        handler_id:  ~
    fragments:       ~
    http_method_override: true

# Twig Configuration
twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"
    form:
      resources:
        - BraincraftedBootstrapBundle:Form:bootstrap.html.twig

# Assetic Configuration
assetic:
    debug:          "%kernel.debug%"
    use_controller: false
    bundles:        [ GarethIndexBundle, GarethpPhotosBundle  ]
    node: /usr/bin/node
    node_paths: [/usr/lib/node_modules]
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        less: ~
#            apply_to: "\.less$"
#        lessphp:
#            file: %kernel.root_dir%/../vendor/oyejorge/less.php/lessc.inc.php
#            apply_to: "\.less$"
        uglifycss:
            bin: /usr/bin/uglifycss
        uglifyjs2:
          bin: /usr/bin/uglifyjs
          apply_to:   "\.js"
        #closure:
        #    jar: "%kernel.root_dir%/Resources/java/compiler.jar"
        #yui_css:
        #    jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"

braincrafted_bootstrap:
    less_filter: less

# Doctrine Configuration
doctrine:
    dbal:
        driver:   "%database_driver%"
        host:     "%database_host%"
        port:     "%database_port%"
        dbname:   "%database_name%"
        user:     "%database_user%"
        password: "%database_password%"
        charset:  UTF8
        # if using pdo_sqlite as your database driver, add the path in parameters.yml
        # e.g. database_path: "%kernel.root_dir%/data/data.db3"
        # path:     "%database_path%"

    orm:
        auto_generate_proxy_classes: "%kernel.debug%"
        auto_mapping: true

# Swiftmailer Configuration
swiftmailer:
    transport: "%mailer_transport%"
    host:      "%mailer_host%"
    username:  "%mailer_user%"
    password:  "%mailer_password%"
    spool:     { type: memory }

gregwar_image:
    throw_exception: true
Теги:

2 ответа

1

Я столкнулся с аналогичной проблемой.

request.CRITICAL: Uncaught PHP Exception LogicException: "The exception handler must be a valid PHP callable." at .../app/cache/prod/classes.php line 1806 {"exception":"[object] (LogicException(code: 0): The exception handler must be a valid PHP callable. at .../app/cache/prod/classes.php:1806)"} []
request.CRITICAL: Uncaught PHP Exception LogicException: "The exception handler must be a valid PHP callable." at .../app/cache/prod/classes.php line 1806 {"exception":"[object] (LogicException(code: 0): The exception handler must be a valid PHP callable. at .../app/cache/prod/classes.php:1806)"} []
request.CRITICAL: Uncaught PHP Exception LogicException: "The exception handler must be a valid PHP callable." at .../app/cache/prod/classes.php line 1806 {"exception":"[object] (LogicException(code: 0): The exception handler must be a valid PHP callable. at .../app/cache/prod/classes.php:1806)"} []
request.CRITICAL: Uncaught PHP Exception LogicException: "The exception handler must be a valid PHP callable." at .../app/cache/prod/classes.php line 1806 {"exception":"[object] (LogicException(code: 0): The exception handler must be a valid PHP callable. at .../app/cache/prod/classes.php:1806)"} []
request.CRITICAL: Uncaught PHP Exception LogicException: "The exception handler must be a valid PHP callable." at .../app/cache/prod/classes.php line 1806 {"exception":"[object] (LogicException(code: 0): The exception handler must be a valid PHP callable. at .../app/cache/prod/classes.php:1806)"} []
request.CRITICAL: Uncaught PHP Exception LogicException: "The exception handler must be a valid PHP callable." at .../app/cache/prod/classes.php line 1806 {"exception":"[object] (LogicException(code: 0): The exception handler must be a valid PHP callable. at .../app/cache/prod/classes.php:1806)"} []

Это произошло после того, как я сделал php composer update на своей локальной машине и передал только серверы src/ и vendor/ dirs на рабочий сервер. После загрузки app/bootstrap.cache.php проблема исчезла.

0

Я не совсем уверен, но где-то вы вызываете Debug::enable(); , Это вызывает дескриптор ExceptionHandler и дескриптор ExceptionHandler ::, поэтому я не знаю, что делает ваша установка.

Попробуйте найти Debug::enable(); и прокомментируйте это, чтобы узнать, не исчезла ли ошибка. Например, что

gregwar_image:
  throw_exception: true

Возможно ли, что Gregwar ExceptionHandler расширяет его, а метод handle не может быть вызван?

  • 0
    Спасибо за ваше сообщение, но после выполнения grep единственное место, где он вызывался, находилось в app_dev.php, и эта ошибка все равно появлялась в прямом эфире. После многих других ошибок я просто закончил работу над новым проектом и скопировал все свои пакеты, конфигурации и прочее.
  • 0
    Хорошо, хорошо, тогда пометьте свой вопрос как решенный;)

Ещё вопросы

Сообщество Overcoder
Наверх
Меню