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

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

问题描述

我遇到这个奇怪的错误,但我没有找到原点. 首先,我想说一下,我之前曾经使用xampp服务器在Windows操作系统上成功完成了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

基本上在配置作曲家等之后,安装运行良好. 在安装过程中未提及任何错误等.

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

但是,最后当我尝试在后端或前端存储区访问时,它显示页面,但没有加载CSS或图像文件. 当我查看缺少的资源时,基本上所有CSS和404都存在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天全站免登陆