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 %}
assets:install
andassetic:dump
? – Polyestercache:clear
or manually clearing the cache folder) helps. And also make sure your assetic is latest version. – Catarinabundles/sharifcalendar/js/...
instead of@SharifCalendarBundle/Resources/public/js/...
. See: craftitonline.com/2011/06/… – Septic