无法在自建Shopware 6商店安装自定义测试应用
问题:Shopware 6自定义应用无法被识别并安装
使用Shopware版本:6.4.20.2
已按官方文档步骤操作,但测试应用无法安装:
- 在
custom/apps/目录下创建了MyExampleApp文件夹 - 文件夹内放置了
manifest.xml,内容如下:
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/trunk/src/Core/Framework/App/Manifest/Schema/manifest-2.0.xsd"> <meta> <name>MyExampleApp</name> <label>Test label to MyExampleApp</label> <label lang="de-DE">Test label DE to MyExampleApp</label> <description>Test description to MyExampleApp.</description> <description lang="de-DE">Test description DE to MyExampleApp.</description> <author>Test Developer</author> <version>1.0.0</version> <license>MIT</license> </meta> </manifest>
执行命令bin/console app:install --activate MyExampleApp时,收到错误:
[INFO] Could not find any app with this name
已清除所有缓存,问题仍存在。
解决方案
1. 检查目录结构与名称匹配
确保路径为custom/apps/MyExampleApp/manifest.xml,注意:
MyExampleApp文件夹名称必须和manifest.xml里<meta><name>标签的内容完全一致(大小写敏感)- 不要嵌套多余目录,比如
custom/apps/MyExampleApp/src/manifest.xml是错误结构
2. 修正manifest.xml的兼容性
你的Shopware版本是6.4.20.2,应使用对应版本的schema链接,替换xsi:noNamespaceSchemaLocation的值:
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/shopware/v6.4.20.2/src/Core/Framework/App/Manifest/Schema/manifest-2.0.xsd"
同时检查xml语法,确保标签闭合、属性引号无错误。
3. 执行应用刷新命令
清除缓存后,先让Shopware扫描识别新应用:
bin/console app:refresh
执行完后运行bin/console app:list,确认MyExampleApp被列出后,再执行安装命令。
4. 修复文件权限
确保Web服务器用户(通常是www-data、nginx或apache)能读取应用目录及文件,执行权限修复命令:
chown -R www-data:www-data custom/apps/MyExampleApp chmod -R 755 custom/apps/MyExampleApp
根据你的服务器环境调整用户组。
5. 检查应用扫描配置
确认config/packages/shopware.yaml中启用了自定义应用扫描:
shopware: app: path: '%kernel.project_dir%/custom/apps' active: true
内容的提问来源于stack exchange,提问作者Евгений Гардыш
相关产品推荐
相关产品推荐

