如何在 magento 2.0 中添加/插入扩展? [英] How to add/Insert Extension in magento 2.0?
问题描述
我尝试添加外部 magento-2 扩展,但我无法添加它,因为我在管理端找不到 magento-connect.我认为管理面板没有 magento-connect.你有什么想法可以分享,或者有什么好的教程可以帮助吗?
I tried to add the external magento-2 extension but I can't add it because I can't find magento-connect in admin side. I think the admin panel doesn't have magento-connect. Do you have any idea about this to share, or a good tutorial that could help?
推荐答案
安装 Magento 2 扩展是一项简单的任务.. 你只需要解压你的扩展 zip 文件并将文件夹放在你的 Magento 2 应用程序/代码目录中,以便结构应该像 app/code/namespace/module-name
Installing Magento 2 extension is an easy task .. you just need to extract your extension zip file and place the folder inside your Magento 2 app/code directory so that the structure should be like app/code/namespace/module-name
然后你必须运行一些命令来注册你的 Magento 2 扩展
then you have to run some commands for registering your Magento 2 extension
在你的 Magento 2 目录中打开终端,平行于应用程序目录
open terminal inside your Magento 2 directory, parallel to the app directory
运行这些命令-
授予对您的 magento 2 目录的读写权限
giving read write permission to your magento 2 directory
sudo chmod -R 777/path of Magento 2 文件夹如/opt/lampp/htdocs/Training/Magento_2.0
sudo chmod -R 777 /path of Magento 2 folder such as /opt/lampp/htdocs/Training/Magento_2.0
如果您使用的是 linux 操作系统,那么您必须运行此命令.对于 Windows,它不是必需的.
if you are using linux operating system then you have to run this command . for windows it is not necessary.
用于注册您的扩展
for registering your extension
/opt/lampp/bin/php bin/magento module:enable Namespace_Modulename
/opt/lampp/bin/php bin/magento setup:upgrade
用于编译扩展代码
/opt/lampp/bin/php bin/magento setup:di:compile
现在刷新你的缓存,从你的 Magento 2 var
目录中删除缓存文件夹.
now flush your cache , delete cache folder from your Magento 2 var
directory.
这篇关于如何在 magento 2.0 中添加/插入扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!