title: PHP 7.1 on macOS Sierra 10.12.3 - installed by Homebrew
body: <p>I've just installed PHP 7.1 with Homebrew and when I type to Terminal <code>$ sudo apachectl restart</code> it returns this message <code>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</code> but everything seems to be working well.</p>
  
  <p><code>phpinfo();</code> returns normal results... </p>
  
  <p><code>php artisan serve</code> returns different URL. <code>http://127.0.0.1:8000</code> instead of <code>http://localhost:8000</code>...</p>
  
  <p>PHP installation steps:</p>
  
  <blockquote>
    <p>brew tap homebrew/dupes</p>
    
    <p>brew tap homebrew/versions</p>
    
    <p>brew tap homebrew/homebrew-php</p>
    
    <p>brew install php71 --with-httpd24</p>
  </blockquote>
  
  <p>In httpd file:</p>
  
  <pre><code>LoadModule php7_module /usr/local/opt/php71/libexec/apache2/libphp7.so
  
  &lt;IfModule php7_module&gt;
   AddType application/x-httpd-php .php
   AddType application/x-httpd-php-source .phps
  
   &lt;IfModule dir_module&gt;
    DirectoryIndex index.html index.php
   &lt;/IfModule&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>What should I do to avoid this error message?</p>
  
  <p>And how can I get the URL <code>http://localhost:8000</code> from Laravel back?</p>
  
  <p>Ok, I found if I add <code>ServerName localhost</code> to the httpd.conf (on this path /usr/local/etc/apache2/2.4/httpd.conf) the warning is gone - thank you to Andrew</p>
  
  <p>But laravel still return 127.0.0.1... any ideas?
  Is it correct installation of PHP 7 on Mac?</p>