- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试为 Wordpress MU 站点设置本地环境。
当我尝试使用默认的 apache/mysql 端口时。我收到错误
Error establishing database connection
当我尝试使用 MAMP 默认端口时,我必须在 header 中指定端口: http://dev.iris.se:8888/
在这种情况下,我会收到 Wordpress 错误
Multisite only works without the port number in the URL.
仅当在 wp-config 中输入正确的数据库设置时才会显示此信息,表明已建立与数据库的连接。
我尝试在端口 80(默认 apache)上运行,在端口 mySQL 上运行 8889(默认 MAMP)。我还尝试在配置文件中指定mamp端口:
localhost:8889
127.0.0.1:8889
有人不知道为什么我可以连接到数据库吗?有没有一种方法可以在端口 8888 上运行网站,而无需在浏览器中指定它?
最佳答案
我的 MAMP 计算机上运行着多个网站,并且发现使用默认 Apache 和 MAMP 设置最简单。
并且您不想通过配置文件以这种方式指定 MAMP 移植,而是修改主 Macintosh 计算机上的/etc/hosts 文件。您不应修改 fe80::1%lo0 localhost
之外的任何内容,因为这会扰乱计算机上读取主机的方式。您在该行下方键入新的虚拟主机,/etc/hosts 文件看起来与此类似:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 localhost
127.0.0.1 examplesite.local
您可以根据需要命名 examplesite.local,这是将在浏览器中显示您的网站的 URL。将这些更改保存到/etc/hosts 文件中,然后转到 Apache 文件夹中的 httpd.conf(该文件的位置位于 Applications/MAMP/conf/apache/httpd.conf 中)。然后,使用如下代码将虚拟主机添加到文件底部,再次将名称 examplesite.local 修改为您希望 URL 在浏览器中显示的任何内容:
NameVirtualHost *
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "/Applications/MAMP/htdocs/examplesitename"
ServerName examplesite.local
</VirtualHost>
对 httpd.conf 文件进行这些更改后,请确保重新启动 MAMP,因为 Apache 服务器需要使这些更改生效。
这是我使用的网站,因为我忘记了命令行来编辑/etc/hosts 文件以及我向您提供的更详细的步骤: http://sawmac.com/mamp/virtual/
以下是 Macintosh 上的原始/etc/hosts 文件的样子,以防您丢失它: http://thecoredump.org/2011/09/editing-the-hosts-file-in-mac-os-x-lion/
此外,请确保您在 MAMP 上运行的每个网站都有单独的数据库、数据库用户以及 htdocs 文件夹中的文件夹。
希望这可以帮助您入门并运行!
关于mysql - Wordpress MU+MAMP 建立数据库连接时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13723657/
我使用 MAMP Pro (4.4)。我在应用程序中有许多 MAMP 文件夹占用了大量空间。删除旧的并保留最新的是否安全?因此保留 MAMP 和 MAMP_2018-02-12_21-21-59(见下
我正在尝试在 MAMP php 中安装 pecl_http。 我收到以下错误。 grep: /Applications/MAMP/bin/php/php5.5.10/include/php/main/
警告:我对 Mac 和 OS X 还是很陌生。 我从 mamp.info 下载了 MAMP 以安装在运行 OSX 10.8.5 的 2012 年末 iMac 上。 安装程序让我可以选择只安装 MAMP
我有 MAMP Pro . 如何让 MAMP Pro 服务器在重启时自动启动? 最佳答案 在 MAMP Pro 版本 4.5(仍然是 5.5.x)中,此选项位于 Ports 下。 关于mamp - 在
我正在使用 MAMP Pro作为开发环境。我用过 ngrok与 MAMP前。但是在这种特殊情况下,它从 ngrok 重定向url 到我的本地 url 并且 https 不可用。 我的本地服务器是 e-
我在带有虚拟主机的 Macbook Pro 上运行 MAMP Pro 4。它工作正常。我希望能够从本地网络上的其他设备访问它,以便测试各种浏览器/操作系统组合。我在网上找到的所有文章和帖子都是针对早期
我在带有虚拟主机的 Macbook Pro 上运行 MAMP Pro 4。它工作正常。我希望能够从本地网络上的其他设备访问它,以便测试各种浏览器/操作系统组合。我在网上找到的所有文章和帖子都是针对早期
我想在我的 Windows 8.1 电脑上运行 MAMP,但是当我启动服务器时,它说: 'APACHE' needs open port '80' which is already being use
我正在尝试安装 libsodium(按照本指南 https://paragonie.com/book/pecl-libsodium/read/00-intro.md#installing-libsod
使用 MAMP Pro,您可以创建诸如“local.example.com”之类的条目并指向本地计算机上该站点的根目录。 有可能自动化吗? 那是在我的电脑上,我的设置如下: 用户/hm/Sites/e
我有时会在 phpMyAdmin 中获取存储在/Library/Application Support/appsolute/db/mysql 下的数据库,这应该是 MAMP PRO 的路径。不过,我不
我正在运行 MAMP,它告诉我它无法写入/etc/hosts 文件。我猜这是一个许可问题,但不完全确定。这是错误: The file /etc/hosts couldn't be written 有什
我的桌面上有一个名为 work 的文件夹,用于保存所有 php 项目。我使用 MAMP 并且所有项目都设置为在虚拟主机上运行,例如,如果我有一个名为 test 的项目,我将通过此 URL http
我试图在我的 php.ini 中将 display_errors = Off 更改为 display_errors = On。我运行了 phpinfo() 并验证了加载的配置文件(它位于:/Libra
我正在将 Laravel/horizon 与 Osx MAMP pro 一起使用 当我运行 Composer 时,它需要 laravel/horizon:~1.0它显示一条消息 - laravel
我正在尝试使用 mamp 设置虚拟主机。当我输入 http://resihop:8888我最终进入 127.0.0.1。为什么? 一些事实: 站点名称:resihop Apache 端口:8888 宿
好的,希望有人能帮帮我。我已经安装了 MAMP PRO(在使用 MAMP 一段时间之后)。 启动 MAMP PRO 时,我已连接到 Apache 服务器和 MySQL。它之所以有效,是因为我同时拥有两
有人知道如何在 MAMP/MAMP Pro 上增加 apache fastCGI 超时吗?我到处找,但似乎找不到。 一如既往地感谢任何帮助。 谢谢, Codarz360 最佳答案 这太乏味了,但终于让
如何更改我的 MAMP mysql.sock 文件路径 /Applications/MAMP/tmp/mysql/mysql.sock 每当我退出 MAMP 或重新启动计算机时,其他内容都不会被删除?
我已经升级到 MAMP Pro,mysql 文件夹不会出现在它们在 MAMP/db 中的位置 MAMP Pro 将 MySQL 数据库保存在哪个位置? 最佳答案 MAMP Pro 的更新版本将数据库保
我是一名优秀的程序员,十分优秀!