如何在本地开始使用Drupal 10?

huangapple go评论60阅读模式
英文:

How get started with drupal10 on localhost?

问题

我正在尝试在 macOS 本地主机上原型化一个 Drupal 10 站点,我已经安装并运行了 Apache 和 MySQL。我已经使用了以下命令:

composer create-project drupal/recommended-project ~/Sites/mysite

/etc/hosts 中,我添加了:

127.0.0.1   mysite.local

稍后我会添加模块和主题。

但是,接下来我应该做什么以访问并开始向 Drupal 10 站点添加内容呢?

许多不同的文档来源,包括 INSTALL.txt 文件,都相当令人困惑,甚至似乎矛盾于关于还需要做什么的信息。

要访问并开始向 Drupal 10 站点添加内容,我应该做什么呢?

文档中说 Drupal 安装程序会创建 MySQL 数据库,但除此之外,我需要做什么来“安装”站点并因此创建数据库呢?

我应该使用哪个 URL?我尝试了 mysite.local,但是 Apache 找不到这样的站点。

请明确指示(并友善一点!)。

英文:

I'm trying to prototype a drupal10 site on a macOS localhost, where I already have apache and mysql installed and running. I already used:

composer create-project drupal/recommended-project ~/Sites/mysite

To /etc/hosts, I added:

127.0.0.1   mysite.local

I'll add modules and a theme later.

But what, exactly do I do next to access and begin adding content to the drupal10 site?

The many and varied sources of documentation, including the INSTALL.txt file, are quite confusing and even seemingly contradictory as to what else needs to be done.

What, exactly do I do next to access and begin adding content to the drupal10 site?

Docs say that the drupal installer creates the mysql database, but exactly what exactly do I need to do further to "install" the site and thereby to have the database created.

And what url do I use? I tried mysite.local, but apache does not find such a site.

Please be explicit (and gentle!).

答案1

得分: 0

回答你的问题:

接下来我该做什么才能访问并开始向Drupal 10网站添加内容?
如果你的安装日志(在你输入composer命令后出现的那段长文本)没有显示任何错误,你需要为你的Drupal网站创建一个数据库:

https://www.drupal.org/docs/installing-drupal/step-3-create-a-database

在创建了数据库之后,你需要配置你的安装,然后可以运行安装程序。在你的浏览器中访问:/core/install.php

我应该使用什么URL?
你尝试过访问http://mysite.local吗?

你看,正如你所说的,这是你指向你的环境的URL,将你的本地主机指向这个URL。

这是官方的Drupal指南:
https://www.drupal.org/docs/getting-started/installing-drupal

但如果你愿意,我有一个建议,它将使你的生活变得轻松许多。使用Lando

https://docs.lando.dev/drupal/getting-started.html

它会创建一个虚拟机,配置和使用都更容易。

英文:

Answering your questions:

What, exactly do I do next to access and begin adding content to the drupal10 site?
If your installation log (that long text on yout terminal, after you type the composer command) don't show any errors you need to create a database to your Drupal website:

https://www.drupal.org/docs/installing-drupal/step-3-create-a-database

After the creation of the database, you need to configure your installation and after that you can run the installer. On your browser access: /core/install.php

And what url do I use?
Have you tryed access http://mysite.local?

You see, as you said that's the URL you have point your enviroment, "telling" to apache point your localhost to this URL.

This is the official Drupal guide:
https://www.drupal.org/docs/getting-started/installing-drupal

But if you prefer, I have a suggestion that will make your life a lot easier. Use Lando:

https://docs.lando.dev/drupal/getting-started.html

It will create a virtual machine, much easier to configure and use.

huangapple
  • 本文由 发表于 2023年4月7日 03:21:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75953045.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定