【问题标题】:Install php with 'grep -i 'DocumentRoot' httpd.conf'使用 'grep -i 'DocumentRoot' httpd.conf' 安装 php
【发布时间】:2016-03-28 15:29:35
【问题描述】:

我正在我的 Mac 上安装 php 并按照以下说明操作:Installing Apache, Php, Mysql on Mac OSX Yosemite.

我停在这个街区:

Mac OS X Yosemite 的默认 DocumentRoot 是 /Library/WebServer/Documents。您可以从您的 Apache 配置中验证这一点。

grep DocumentRoot httpd.conf

现在在 DocumentRoot 中创建 phpinfo() 页面:

echo ' /Library/WebServer/Documents/phpinfo.php 访问http://localhost/phpinfo.php验证PHP

但我得到的是以下内容:

'grep : httpd.conf : No such file or directory' 消息阻碍了我现在的进度。

有没有 php 专家可以帮助我? 我只是按照说明操作..

【问题讨论】:

  • 我没有Mac,但假设配置文件在/etc/apache2,你可以试试grep DocumentRoot /etc/apache2/httpd.conf

标签: php mysql macos apache


【解决方案1】:

试试grep -i Documentroot /etc/apache2/httpd.conf

Grep 用于在其他文件中搜索文本。您当前正在您自己的 Documents 文件夹中执行 grep。 Apache 的配置不在那里。

【讨论】:

    【解决方案2】:

    首先转到您有 httpd.conf 的目录,然后尝试使用 grep。
    或者干脆试试这个命令 -> find / -iname httpd.conf。复制位置,grep -i DocumentRoot(位置)。 不带括号的文件位置。

    【讨论】:

      猜你喜欢
      • 2014-07-29
      • 2013-04-17
      • 2014-12-30
      • 1970-01-01
      • 2017-09-18
      • 1970-01-01
      • 2013-06-12
      • 2023-02-03
      • 2013-11-14
      相关资源
      最近更新 更多