symfony assetic 在请求文件时给出 500 错误 [英] symfony assetic gives 500 error when requesting files
问题描述
已编辑:我在 symfony2 中使用资产.每次我尝试加载页面时,在请求 JS 和 CSS 文件时,我的浏览器都会收到 500 错误.如果我在地址栏中输入该资源的地址,我可以成功加载它的文件!更奇怪的是,每当 Symfony 启动时,CPU 负载就会增加 30%!
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!
我尝试了 assets:install
和 assetic:dump --no-debug
,你猜怎么着,没有一个 symfony 页面加载了.它们都以 500 错误结束.
I tried assets:install
and assetic:dump --no-debug
, guess what, none of the symfony pages load anymore. They all end in 500 error.
我不认为这是由 apache 引起的.我可以加载任何其他静态的 PHP 页面,我也尝试过 nginx 并得到 500 错误.我必须cache:clear
才能取回它们.
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.
有什么想法吗?我已经更新并重新安装了我的 Web 服务器、CGI、PHP,并使用了 symfony 的新副本并复制了源代码,但没有任何帮助.
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.
转储:这就是我在 JS 中使用 Assetic 的方式.css 也有类似的块:
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 %}
推荐答案
为了更好地理解正在发生的事情,也许您可以在详细模式下执行与资产相关的命令(使用时从您的项目根目录标准的 Symfony2 版本)?
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
这篇关于symfony assetic 在请求文件时给出 500 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!