gpt4 book ai didi

apache - Docker 错误 : Cannot create container for service web: invalid mode

转载 作者:行者123 更新时间:2023-12-02 17:57:48 26 4
gpt4 key购买 nike

运行 docker 时出现三个错误:

ERROR: for learningphp7_web_1 Cannot create container for service web: invalid mode: /etc/apache2/sites-enabled/virtualhosts.conf

ERROR: for web Cannot create container for service web: invalid mode: /etc/apache2/sites-enabled/virtualhosts.conf

ERROR: Encountered errors while bringing up the project.


我该如何解决这些问题并最终开始使用 docker?
我的 virtualhosts.conf :
<VirtualHost *:80>
ServerName localhost
DocumentRoot /var/www/html/web
DirectoryIndex index.php

<Directory /var/www/html/web>
AllowOverride None
Require all granted
Allow from All
Options FollowSymLinks
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</Directory>
</VirtualHost>

最佳答案

检查您的 docker-compose.yml 文件。由于卷配置中的额外空间,我最近遇到了同样的错误:

  volumes:
- ./www:/home/distressedpro/public_html
- ./conf:/etc/apache2/sites-available

请注意最后一行的额外空间,这是导致错误的原因。将其更正为:
  volumes:
- ./www:/home/distressedpro/public_html
- ./conf:/etc/apache2/sites-available

修复

关于apache - Docker 错误 : Cannot create container for service web: invalid mode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48425660/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com