【问题标题】:Error Twig when I try to run Symfony 3 project on server当我尝试在服务器上运行 Symfony 3 项目时出现错误 Twig
【发布时间】:2017-03-25 09:46:01
【问题描述】:

我实际上尝试在我的服务器上(使用 Plesk)在 Symfony 3.2 中安装一个新项目。

我把 PHP 7.0.17.

当我在“app_dev”中查看我的网站时,没问题,但没有它就无法工作。

我认为与运行“php bin/console assetic-dump --env=prod”时的错误有关:

[2017-03-25 10:20:21] assetic.ERROR: The template "SecurityBundle:Collector:security.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle::layout.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:exception.rdf.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:error.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:error.css.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:logs.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:error.rdf.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:exception.xml.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:error.xml.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:traces_text.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:traces.txt.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:exception.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:error.json.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:error.atom.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:exception.atom.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:exception.json.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:traces.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:error.txt.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:exception.js.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:error.js.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:trace.txt.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:trace.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:exception.css.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:traces.xml.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:exception.txt.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "TwigBundle:Exception:exception_full.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "SwiftmailerBundle:Collector:swiftmailer.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "DoctrineBundle:Collector:db.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "DoctrineBundle:Collector:explain.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LocationFrontBundle:Accueil/Partials/A-la-une:location.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LocationFrontBundle:Accueil:index.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LocationFrontBundle:Layout:layout.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LocationFrontBundle:Layout:footer.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LocationFrontBundle:Layout/Accueil:menu.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LocationFrontBundle:Layout/Accueil:header.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LocationFrontBundle:Layout/Accueil:layout.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LocationFrontBundle:Layout/Autre:layout.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LocationBackBundle:Default:index.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "WhiteOctoberBreadcrumbsBundle::breadcrumbs.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LexikFormFilterBundle:Form:form_div_layout.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "LiipImagineBundle:Form:form_div_layout.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template ":default:index.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined
[2017-03-25 10:20:21] assetic.ERROR: The template "::base.html.twig" contains an error: Catchable Fatal Error: Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in /xxx/vendor/twig/twig/lib/Twig/Extension/Core.php on line 139 and defined

当我搜索解决方案时,我发现我必须把 PHP 7.0.17。 但它已经完成了。

有人可以帮我吗?

提前谢谢你。

【问题讨论】:

    标签: symfony server twig symfony-3.2


    【解决方案1】:

    Plesk PHP - 版本有不同的 PHP - 可执行文件:

    /opt/plesk/php/5.2/bin/php -v
    /opt/plesk/php/5.3/bin/php -v
    /opt/plesk/php/5.4/bin/php -v
    /opt/plesk/php/5.5/bin/php -v
    /opt/plesk/php/5.6/bin/php -v
    /opt/plesk/php/7.0/bin/php -v
    /opt/plesk/php/7.1/bin/php -v
    

    请。使用完整的命令路径,因为没有完整路径的命令“php ...”将使用您的标准供应商 PHP 版本(即:/usr/bin/php)执行

    【讨论】:

      猜你喜欢
      • 2018-11-23
      • 2019-09-23
      • 2022-11-25
      • 2015-09-01
      • 2020-09-30
      • 1970-01-01
      • 2022-07-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多