0

我正在尝试配置 symfony 资产管理器来编译我的较少 css 文件并重写路径但是我收到以下错误:

Dumping all dev assets.
Debug mode is on.
18:51:01 [file+] C:/htdocs/site-ideiah-symfony/app/../web/css/57b3454.css
[Assetic\Exception\FilterException]
An error occurred while running:
"C:\Users\Rafael\AppData\Local\Temp\ass1C74.tmp"

Error Output:
Access Denied

我的 config.yml

filters:
    cssrewrite: 
        apply_to: '\.(css|less)$'
    less: 
        node: [ "C:\\Program Files\\nodejs\\node.exe" ]      
        node_paths: [ "C:\\Program Files\\nodejs\\", "C:\\Program Files\\nodejs\\node_modules\\" ]
        apply_to: "\.less$"

我的模板使用

  {% block stylesheets %}
        {% stylesheets filter='less,cssrewrite'
            '@IdeiahSiteAppBundle/Resources/public/less/style.less'
        %}
        <link href="{{ asset_url }}" type="text/css" rel="stylesheet" media="all" />
        {% endstylesheets %}
    {% endblock %}

我正在使用带有 PHP 5.4.7 的 Windows 8,有谁知道我该如何修复它?

4

2 回答 2

1

Error Output: Access Denied消息暗示这是一个与安全相关的问题。

此安全问题可能与 1) 无法写入输出文件、2) 无法读取输入文件和/或 3) 无法执行node命令有关

1)运行assetic:dump命令的用户是否能够写入文件夹C:/htdocs/site-ideiah-symfony/web/css/57b3454.css文件?

2) 之后Error Output:,assetic 还应该显示使用的输入,类似这样:

Input:
/*!
 * Bootstrap v2.3.1
 *
 * Copyright 2012 Twitter, Inc
 * Licensed under the Apache License v2.0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Designed and built with all the love in the world @twitter by @mdo and @fat
 */

// Core variables and mixins
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
@import "mixins.less";

// CSS Reset
@import "reset.less";

看到列出的任何输入吗?

3)检查用户是否"C:\Program Files\nodejs\node.exe"从命令行执行

于 2013-03-13T11:34:11.427 回答
0

我有一个类似的问题。删除 Less 并安装旧版本为我修复了它。其他解决方案之一似乎是将 symfony 升级到新版本,但我们无法这样做,因为必须使用与 centos6.5 兼容的旧版本 symfony

这有帮助:https ://github.com/braincrafted/bootstrap-bundle/issues/217

于 2014-11-14T15:53:13.707 回答