[英]PHP 7.1 on macOS Sierra 10.12.3 - installed by Homebrew
我刚刚用 Homebrew 安装了 PHP 7.1,当我输入终端$ sudo apachectl restart
它返回此消息AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.3.1.156. Set the 'ServerName' directive globally to suppress this message
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.3.1.156. Set the 'ServerName' directive globally to suppress this message
但一切似乎都运行良好。
phpinfo();
返回正常结果...
php artisan serve
返回不同的 URL。 http://127.0.0.1:8000
而不是http://localhost:8000
...
PHP安装步骤:
酿造自来水自制/欺骗
brew tap 自制软件/版本
酿造自来水自制软件/自制软件-php
brew install php71 --with-httpd24
在 httpd 文件中:
LoadModule php7_module /usr/local/opt/php71/libexec/apache2/libphp7.so
<IfModule php7_module>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
</IfModule>
我应该怎么做才能避免出现此错误消息?
我怎样才能从 Laravel 取回 URL http://localhost:8000
呢?
好的,我发现如果我将ServerName localhost
添加到 httpd.conf(在此路径 /usr/local/etc/apache2/2.4/httpd.conf 上)警告消失了 - 谢谢安德鲁
但是 Laravel 仍然返回 127.0.0.1 ... 有什么想法吗? 在 Mac 上正确安装 PHP 7 吗?
安装后 PHP 7 brew install php71 --with-httpd24
运行这个命令brew unlink httpd24
然后在 macOS Apache (/etc/apache2/httpd.conf) 上编辑 httpd.conf...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.