【Magento 2学习】

mac2022-06-30  18

1.

Q:/usr/bin/env: ‘php\r’: No such file or directory

A:输入:set ff=unix 再输入:wq 保存

Q:There are no commands defined in the "setup" namespace.

A:php bin/magento list

Q:Warning: Invalid argument supplied for foreach() in /var/www/html/vendor/ma gento/module-eav/Model/Config.php on line 341

A:Two ways to fix this issue.Fixed it by changing the line 96 in this file vendor/magento/module-config/Model/Config/Structure/Converter.php. Actual Code: if ($children->length && trim($child->nodeValue, "\n ") === '') { Corrected Code: if ($children->length && trim($child->nodeValue, "\n\t ") === '') { Check if your XML file has any tab spacing within it. If so, remove the tab spacing and replace them with normal single spaces.

2.

删除通过docker-compose生成的数据卷:docker-compose down --volumes

创建管理员 php bin/magento admin:user:create --admin-user=admin --admin-password=admin123 --admin-firstname=Kayla --admin-lastname=Cheng

docker-compose安装: sudo -i                   curl -L https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose             chmod +x /usr/local/bin/docker-compose exit docker-compose --version

常用命令:php bin/magento setup:static-content:deploy -f 编译静态资源php bin/magento indexer:reindex     刷新索引php bin/magento setup:upgrade  更新数据php bin/magento moudule:enable Test_Hello(module的名称)  启用此modulephp bin/magento setup:db-schema:upgradephp bin/magento setup:db-data:upgradephp bin/magento deploy:mode:set production/developer/default

 

转载于:https://www.cnblogs.com/paopaocheng/p/11249179.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)