symfony assetic gives 500 error when requesting files

青春壹個敷衍的年華 提交于 2019-12-10 14:44:38

问题


EDITED: I am using assetic with symfony2. Each time I try to load a page, on requesting for the JS and CSS files, my browser gets a 500 error. If I type the address of that resource in address bar, I can load its file successfully! Even weirder, the CPU load increases like 30% whenever Symfony boots up!

I tried assets:install and assetic:dump --no-debug, guess what, none of the symfony pages load anymore. They all end in 500 error.

I don't think it is caused by apache. I can load any other static of PHP pages, and I also tried nginx and got a 500 error. I have to cache:clear in order to get them back.

Any idea? I have already updated and reinstalled my web server, CGI, PHP and used a fresh copy of symfony and copied the sources, none of them helped.

dump: This is how I used Assetic with JS. There is a similar block for css:

{% javascripts
            '@SharifCalendarBundle/Resources/public/js/kendoui/jquery.min.js'
            '@SharifCalendarBundle/Resources/public/js/JQueryUi/jquery-ui-1.10.3.custom.min.js'
            '@SharifCalendarBundle/Resources/public/js/noty/jquery.noty.js'
            '@SharifCalendarBundle/Resources/public/js/noty/layouts/top.js'
            '@SharifCalendarBundle/Resources/public/js/noty/layouts/topLeft.js'
            '@SharifCalendarBundle/Resources/public/js/noty/layouts/topRight.js'
            '@SharifCalendarBundle/Resources/public/js/noty/themes/default.js'
            '@SharifCalendarBundle/Resources/public/js/kendoui/kendo.web.min.js'
        %}
    <script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}

回答1:


In order to have a better understanding of what is going in, perhaps you could execute the commands related to assets in verbose mode (from your project root directory when using a standard Symfony2 edition) ?

php app/console assets:install --symlink -v 
php app/console assetic:dump -v


来源:https://stackoverflow.com/questions/17636025/symfony-assetic-gives-500-error-when-requesting-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!