2017-01-29 3 views
-2

symfonyの3.1.xへへのSymfony 2.9.Xからの私のプロジェクトをアップグレードした後、サイトは常にエラーをスローされています:SYMFONY 3.1 | TWIG - Markup.php(2.9.Xからの移行以来、エラーをスロー)

Error in Markup.php located in vendor/twig

を私は現在この特定の問題に困惑しており、解決できません。

composer.json:

{ 
    "name": "jordan/.checkout", 
    "license": "proprietary", 
    "type": "project", 
    "autoload": { 
     "psr-4": { 
      "": "src/" 
     }, 
     "classmap": [ 
      "app/AppKernel.php", 
      "app/AppCache.php" 
     ] 
    }, 
    "autoload-dev": { 
     "psr-4": { 
      "Tests\\": "tests/" 
     } 
    }, 
    "require": { 
     "php": ">=5.5.9", 
     "symfony/symfony": "3.1.*", 
     "doctrine/orm": "^2.5", 
     "doctrine/doctrine-bundle": "^1.6", 
     "doctrine/doctrine-cache-bundle": "^1.2", 
     "symfony/swiftmailer-bundle": "^2.3", 
     "symfony/monolog-bundle": "^2.8", 
     "sensio/distribution-bundle": "^5.0", 
     "sensio/framework-extra-bundle": "^3.0.2", 
     "incenteev/composer-parameter-handler": "^2.0", 
     "symfony/assetic-bundle": "^2.8.0" 
    }, 
    "require-dev": { 
     "sensio/generator-bundle": "^3.0", 
     "symfony/phpunit-bridge": "^3.0" 
    }, 
    "scripts": { 
     "post-install-cmd": [ 
      "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 
     ], 
     "post-update-cmd": [ 
      "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile", 
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget" 
     ] 
    }, 
    "extra": { 
     "symfony-app-dir": "app", 
     "symfony-bin-dir": "bin", 
     "symfony-var-dir": "var", 
     "symfony-web-dir": "httpdocs", 
     "symfony-tests-dir": "tests", 
     "symfony-assets-install": "relative", 
     "incenteev-parameters": { 
      "file": "app/config/parameters.yml" 
     } 
    } 
} 
+0

AppKernel.php - http://pastebin.com/aNUSYuYt のDevログインします。http ://pastebin.com/DwdGGkyY プロダクトログ:http://pastebin.com/iXqqudKZ –

+0

Markup.phpファイルの20行目のコードは何ですか?あなたは単に "use"ステートメントが欠落しているようです...他のエラーはあなたの 'config.yml'に関するものですので、あなたもそれを投稿する必要があります。 –

+0

このエラーが発生したときに使用したPHPバージョンはどれですか? – xabbuh

答えて

0

JsonSerializable PHPインターフェースです。

JsonSerializableの代わりに\JsonSerializableのバックスラッシュを追加するか、ファイルの先頭にuse文を追加してください(use JsonSerializable;)。

そうでない場合、それは(たとえばAppBundle\AppBundle\Twig\JsonSerializableのために、私はMarkup.phpがどこにあるかわからない)あなたのバンドルになります

+0

バックスラッシュを追加して問題を解決しました。 useステートメントは、それが私の最初のアイデアだったので動作していないようでした。後で、プロジェクトファイルをスクラップし、Symfony 3のクリーンバージョンを使用し、あまりにも多くのパッチワークが問題を引き起こすため、コードを移植します。 –

関連する問題