安装 magento 2 不会部署/pub/static/frontend 和 backend [英] Installing magento 2 does not deploy the /pub/static/frontend and backend

查看:17
本文介绍了安装 magento 2 不会部署/pub/static/frontend 和 backend的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这个奇怪的错误,但我没有成功找到来源.首先我想说我之前在带有xampp服务器的windows os上成功安装了Magento 2.

I'm having this weird error and I did not suceed to find the origin. First of all I would like to say that I succeeded to perform some installation of Magento 2 on a windows os with a xampp server before.

我现在正在尝试使用 IIS 在 Windows Server 上安装 magento 实例

I'm now trying to install a magento instance on Windows Server with IIS

基本上在配置 Composer 等之后,安装运行良好.安装过程中没有提到错误等.

Basically after configuring composer etc.. the installations runs well. No error mentioned during the installation process etc..

但是最后当我尝试在后端或前台访问时,它会显示页面但没有加载 css 或图像文件.当我查看丢失的资源时,基本上所有 css & 都有 404 错误.图像文件应该位于以下文件夹中

However at the end when I try to access at the backend or the front store it display the page but no css or images files are loaded. When I looked in the missing ressources, basically I have 404 errors for all css & images files supposed to be located in the following folders

pub/static/frontend/*
pub/static/backend/*

实际上在我的文件夹 pub/static/中只有 _requirejs 文件夹和 .htaccess 文件,但没有文件夹前端和后端

Physically in my folder pub/static/ there is only the _requirejs folder and .htaccess file but no folder frontend and backend

我猜文件夹前端和后端是自动生成的,因为在 magento 2.0 的初始克隆中默认情况下它们不是

I guess the folder frontend and backend are generated automatically because they are not by default in the initial clone of magento 2.0

所以如果有人知道问题可能来自哪里.

So if anyone has got any ideas of where the problem could come from.

需要考虑的其他信息:我已检查权限,Web 服务器对每个文件夹和文件 magento 2.0 根目录具有完全访问权限(读取和写入).

Additional information to consider: I have checked the permissions, the web server has full access (read and write) on every folders and file magento 2.0 root directory.

推荐答案

更简单的方法是从 magento 根文件夹运行以下命令.

An easier would be to run below command from magento root folder.

php bin/magento setup:static-content:deploy

这将在各自的文件夹中完美地提供内容.如果您有特定语言,请按如下方式运行.

This will feed the content perfectly in respective folders. If you have specific language then run like below.

php bin/magento setup:static-content:deploy en_US
php bin/magento setup:static-content:deploy en_GB

这篇关于安装 magento 2 不会部署/pub/static/frontend 和 backend的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆