我正在使用Capifony部署我的Symfony应用程序。当Capifony执行assetic:dump时,我遇到了运行时异常。
在同一服务器上的另一个域中,我有完全相同的代码,但是手动部署。那里我没有遇到这个错误。所以不能是PHP版本的问题。我还检查了Assetic和Assetic-Bundle版本,它们是相同的。
assetic工作不同的原因可能是什么?
编辑:
我忘记提到它也在我的开发机器上正常工作。
编辑2:
它在以下文件开始失败
我尝试手动执行命令并获得相同的异常。然后我尝试使用--verbose参数执行该命令,并意识到所有带有点的源路径的文件都只写了扩展名而没有文件名。当尝试写只有一个点的文件(在此情况下为Makefile)时会出现异常。[RuntimeException]
无法写入文件 {path}/releases/20130314071536/app/../web/js/。
在同一服务器上的另一个域中,我有完全相同的代码,但是手动部署。那里我没有遇到这个错误。所以不能是PHP版本的问题。我还检查了Assetic和Assetic-Bundle版本,它们是相同的。
assetic工作不同的原因可能是什么?
编辑:
我忘记提到它也在我的开发机器上正常工作。
编辑2:
它在以下文件开始失败
web/bundles/assets/assets/images/icons/aws.png
我没有在任何模板中使用的文件。
从错误中获取的堆栈跟踪。Exception trace:
() at /home/yanic.info/domains/pe.yanic.info/public_html/releases/20130318143912/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php:249
Symfony\Bundle\AsseticBundle\Command\DumpCommand->doDump() at /home/yanic.info/domains/pe.yanic.info/public_html/releases/20130318143912/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php:187
Symfony\Bundle\AsseticBundle\Command\DumpCommand->dumpAsset() at /home/yanic.info/domains/pe.yanic.info/public_html/releases/20130318143912/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php:64
Symfony\Bundle\AsseticBundle\Command\DumpCommand->execute() at /home/yanic.info/domains/pe.yanic.info/public_html/releases/20130318143912/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:238
Symfony\Component\Console\Command\Command->run() at /home/yanic.info/domains/pe.yanic.info/public_html/releases/20130318143912/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:192
Symfony\Component\Console\Application->doRun() at /home/yanic.info/domains/pe.yanic.info/public_html/releases/20130318143912/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:78
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /home/yanic.info/domains/pe.yanic.info/public_html/releases/20130318143912/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:105
Symfony\Component\Console\Application->run() at /home/yanic.info/domains/pe.yanic.info/public_html/releases/20130318143912/app/console:33
config.yml
# Twig Configuration
twig:
debug: %kernel.debug%
strict_variables: %kernel.debug%
form:
resources: [HomeBundle:Form:fields.html.twig]
# Assetic Configuration
assetic:
write_to: "%kernel.root_dir%/../web"
debug: %kernel.debug%
use_controller: false
bundles: ['YanicSecurityBundle','HomeBundle','UsersBundle','CmsBundle','AssetsBundle','FormBundle','TranslationBundle','EventBundle','ShopBundle','NewsletterBundle','IssueBundle','ProjectBundle']
filters:
cssrewrite: ~
编辑4:
当搜索aws.png(第一个损坏的结果)时,缓存文件中有2个结果:
/Applications/MAMP/htdocs/symfony-standard-2.1/app/cache/dev/appDevUrlGenerator.php:
112 '_assetic_e4d7f8d' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => 'e4d7f8d', 'pos' => NULL, '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/assets/images/icons/arrow_rotate_clockwise.png', ), ),),
113 '_assetic_e4d7f8d_0' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => 'e4d7f8d', 'pos' => '0', '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/assets/images/icons/arrow_rotate_clockwise_arrow_rotate_clockwise_1.png', ), ),),
114: '_assetic_e1ec2e3' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => 'e1ec2e3', 'pos' => NULL, '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/assets/images/icons/aws.png', ), ),),
115 '_assetic_e1ec2e3_0' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => 'e1ec2e3', 'pos' => '0', '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/assets/images/icons/aws_aws_1.png', ), ),),
116 '_assetic_490c282' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => '490c282', 'pos' => NULL, '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/assets/images/icons/cancel.png', ), ),),
...
874 '_assetic_13192a1' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => '13192a1', 'pos' => NULL, '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/images/icons/arrow_rotate_clockwise.png', ), ),),
875 '_assetic_13192a1_0' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => '13192a1', 'pos' => '0', '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/images/icons/arrow_rotate_clockwise_arrow_rotate_clockwise_1.png', ), ),),
876: '_assetic_3d6d4c9' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => '3d6d4c9', 'pos' => NULL, '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/images/icons/aws.png', ), ),),
877 '_assetic_3d6d4c9_0' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => '3d6d4c9', 'pos' => '0', '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/images/icons/aws_aws_1.png', ), ),),
878 '_assetic_5ea17b1' => array ( 0 => array ( ), 1 => array ( '_controller' => 'assetic.controller:render', 'name' => '5ea17b1', 'pos' => NULL, '_format' => 'png', ), 2 => array ( ), 3 => array ( 0 => array ( 0 => 'text', 1 => '/js/images/icons/cancel.png', ), ),),
/Applications/MAMP/htdocs/symfony-standard-2.1/app/cache/dev/appDevUrlMatcher.php:
517
518 // _assetic_e1ec2e3
519: if ($pathinfo === '/js/assets/images/icons/aws.png') {
520 return array ( '_controller' => 'assetic.controller:render', 'name' => 'e1ec2e3', 'pos' => NULL, '_format' => 'png', '_route' => '_assetic_e1ec2e3',);
521 }
...
4327
4328 // _assetic_3d6d4c9
4329: if ($pathinfo === '/js/images/icons/aws.png') {
4330 return array ( '_controller' => 'assetic.controller:render', 'name' => '3d6d4c9', 'pos' => NULL, '_format' => 'png', '_route' => '_assetic_3d6d4c9',);
4331
编辑5:
按照@cheesemacfly的建议,我删除了hearsay_require_js包,问题已经解决。现在我知道错误的原因,在部署到Capifony和测试服务器时为什么会出现这种情况呢?
aws.png
文件,你确定吗?如果你在整个项目的所有文件中进行搜索呢? - cheesemacfly