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的名称) 启用此module
php bin/magento setup:db-schema:upgrade
php bin/magento setup:db-data:upgrade
php bin/magento deploy:mode:set production/developer/default