不知何故,路由不了解从哪里获取我的 Assets ,它缺少基本演示的 3 个 css 文件:
http://sub. domain.ext/bundles/framework/css/structure.css
http://sub.domain.ext/bundles/framework/css/body.css
http://sub.domain.ext/bundles/framework/css/exception.css
服务器运行 Ubuntu 并安装了 Plesk。
等等/var/www/vhosts/system/sub.domain.ext/conf/vhost.conf
我已经告诉服务器寻找我的项目:
ServerName sub.domain.ext
ServerAlias www.sub.domain.ext
DocumentRoot /var/www/vhosts/domain.ext/sub.domain.ext/projectmanagement/web
<Directory /var/www/vhosts/domain.ext/sub.domain.ext/projectmanagement/web>
# enable the .htaccess rewrite
AllowOverride All
Order allow,deny
Allow from All
</Directory>
ErrorLog /var/log/apache2/project_error.log
CustomLog /var/log/apache2/project_acces.log combined
我还尝试将模板 -> assets_base_url 添加到 config.yml 但没什么重要的,我继续获取丢失的 Assets 。
如果有人以前有过子域和 symfony2 的经验,请告诉我秘诀以使其正常工作
最佳答案
您可能想要检查的 list
php app/console assets:install
确保 Assets 已安装且可用php app/console assetic:dump --env=prod --no-debug
这会将 Assets 物理放置在 web 文件夹中以在生产环境中使用。 {% stylesheets 'bundles/bundlename/css/*'%}
然后记得添加cssrewrite
喜欢 {% stylesheets 'bundles/bundlename/css/*' filter='cssrewrite' %}
我希望这有帮助
关于apache - Ubuntu 14.4.01 子域上的 Symfony2 - 缺少 Assets ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28511316/