【问题标题】:Why can't ngnix or docker see the index.php file?为什么 ngnix 或 docker 看不到 index.php 文件?
【发布时间】:2021-08-09 21:28:56
【问题描述】:

我在 Ubuntu 中创建了我的项目文件夹:/home/my_username/Projects/drupal9doc1
并放入此文件夹:Docker-based Drupal stack
配置好docker-compose.yml.env文件,然后在终端写命令:docker-compose up -d
运行Drupal站点本地崛起所需的镜像。

我在我的项目文件夹中创建了带有phpinfo() 函数的index.php 文件来测试一切是如何工作的。
我在网址中写了http://drupal9doc1.localhost:8000
并且File not found显示在我的page页面而不是php版本。

Part of the code in the docker-compose.yml file

Part of the code in the .env file

对于为什么 nginx / docker 的 index.php 文件不可见,您有什么建议吗?
如果您需要更多信息,请在 cmets 中写信给我。

【问题讨论】:

    标签: php docker nginx drupal


    【解决方案1】:

    首先,检查 nginx 设置是否与当前项目文件夹匹配:/home/my_username/Projects/drupal9doc1 检查执行文件夹的权限,并检查nginx是否真的在上升,或者有错误。

    【讨论】:

    • 你能告诉我怎么做更详细吗?因为我还是个初学者。
    • 您阅读过 docker4drupal 文档吗? wodby.com/docs/1.0/stacks/drupal/local/#mount-my-codebase。特别是说“确保 NGINX_SERVER_ROOT(或 APACHE_DOCUMENT_ROOT)是正确的,默认设置为 /var/www/html/web 对于 Drupal 位于 web 子目录中的基于作曲家的项目”的部分
    • @2pha 但我没有基于作曲家的项目!我将从存档中的 drupal.org 下载 drupal!另外,我什至还没有达到下载/安装 Drupal 的阶段。目前我只是测试我的运行图像是如何工作的。我可以通过创建一个文件 index.php 来检查它,因为它有一个书面函数 phpinfo();
    【解决方案2】:

    解决方案:您需要从项目文件夹中删除docker-compose-override.yml 文件,它应该可以工作。

    【讨论】:

      猜你喜欢
      • 2016-01-10
      • 1970-01-01
      • 1970-01-01
      • 2015-07-04
      • 1970-01-01
      • 2018-04-03
      • 2021-10-25
      • 2021-04-29
      • 2012-05-13
      相关资源
      最近更新 更多