403 docker/ddev网站上禁止使用nginx



我正试图使用带有DDev的Docker,使用WSL2在本地部署一个站点。我已经实现了phpMyAdmin的工作,并且我有一个ddev url,但当我尝试使用ddev launch和/或转到http://sitename.ddev.site我得到一个403错误。

到目前为止,我已经尝试将docroot更改为public,但没有成功。此外,我在docker容器中加入了SSH,所有适当的文件都在那里。我的目录层次结构看起来像(在powershell中使用ls(:

~/dev/project_name$ ls

composer.json composer.lock project_name public sites vendor

此外,当我用运行drupal安装命令时,这可能是一个单独的问题,也可能是不相关的——但如果不是这样的话

ddev exec drush site:install --account-name=admin --account-pass=admin

我被要求提供数据库名称/驱动程序/用户名/密码/主机/端口——我不完全确定它希望我提供什么信息。我设法在Docker中找到了数据库信息,但显然我无法正确地为其提供正确的信息。输入和输出:


Database name [drupal]:
> db
Database driver [mysql]:
> mysql
Database username [drupal]:
> db
Database password [drupal]:
> root
Database host [127.0.0.1]:
> localhost
Database port [3306]:
> 3306
[warning] Program UNKNOWN not found. Proceed if you have already created or emptied the Drupal database.
Do you want to continue? (yes/no) [yes]:
> yes
[notice] Starting Drupal installation. This takes a while.
[notice] Performed install task: install_select_language
[notice] Performed install task: install_select_profile
[notice] Performed install task: install_load_profile
[notice] Performed install task: install_verify_requirements
In install.core.inc line 971:
Database name field is required.
Database username field is required.
Resolve all issues below to continue the installation. For help configuring your database server, see the <a href="https://www.dr
upal.org/docs/8/install">installation handbook</a>, or contact your hosting provider.<div class="item-list"><ul><li>Failed to con
nect to your database server. The server reports the following message: <em class="placeholder">SQLSTATE[HY000] [2002] No such fi
le or directory</em>.<ul><li>Is the database server running?</li><li>Does the database exist or does the database user have suffi
cient privileges to create the database?</li><li>Have you entered the correct database name?</li><li>Have you entered the correct
username and password?</li><li>Have you entered the correct database hostname and port number?</li></ul></li></ul></div>

Failed to execute command drush site:install --account-name=admin --account-pass=admin: exit status 1```

下一个通知应该是:

[注意]执行的安装任务:install_verify_database_ready

可能数据库已关闭、未连接,或者访问数据错误

检查德鲁伊状态:

ddev exec drush st

Drupal版本:9.3.2
站点URI:http://my-drupal9-site.ddev.site数据库驱动程序:mysql

复制步骤,没有错误

安装brew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

安装ddev

brew install drud/ddev/ddev

启动容器

cd ~/dockertests/
mkdir my-drupal9-site
cd my-drupal9-site
ddev config --project-type=drupal9 --docroot=web --create-docroot
ddev start
ddev composer create "drupal/recommended-project"
ddev composer require drush/drush
ddev drush site:install -y
ddev drush uli
ddev launch
# [success] Installation complete.  User name: admin  User password: XXXX

重新安装drupal

ddev exec drush site:install --account-name=admin --account-pass=admin

最新更新