title: apache restart error Segmentation fault: 11 $HTTPD "$@"
body: <p>I'm new to web development and wanted to create my own local server on mac os Sierra in order to do some development. I've followed a (few) tutorials on getting apache , php and mysql up and running, and have only made it to the php part ,which is where I am failing at the moment.</p>
  
  <p>I managed to access localhost via <a href="http://localhost/~username" rel="nofollow noreferrer">http://localhost/~username</a> and found my directory there, however once I uncomment the php LoadModule in the httpd.conf my ability to access localhost fails and I am thrown with the error <code>ERR_CONNECTION_REFUSED</code>. This is  after I tried to restart apache using </p>
  
  <pre><code>sudo apachectl -k restart
  </code></pre>
  
  <p>Which threw this error:</p>
  
  <blockquote>
    <p>httpd not running, trying to start
    /usr/sbin/apachectl: line 92: 11399 Segmentation fault: 11  $HTTPD "$@"</p>
  </blockquote>
  
  <p>The error logs from <code>tail -f /var/log/apache2/error_log</code>, had the following to say: </p>
  
  <blockquote>
    <p>AH00112: Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist
    AH00112: Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist
    [Mon May 01 19:33:52.138346 2017] [mpm_prefork:notice] [pid 3454] AH00163: Apache/2.4.23 (Unix) PHP/7.1.1 configured -- resuming normal operations
    [Mon May 01 19:33:52.138434 2017] [core:notice] [pid 3454] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
    [Mon May 01 19:37:22.694456 2017] [mpm_prefork:notice] [pid 3454] AH00169: caught SIGTERM, shutting down
    AH00112: Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist
    AH00112: Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist
    [Mon May 01 19:53:54.632167 2017] [mpm_prefork:notice] [pid 4059] AH00163: Apache/2.4.23 (Unix) PHP/7.1.1 configured -- resuming normal operations
    [Mon May 01 19:53:54.632251 2017] [core:notice] [pid 4059] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
    [Mon May 01 20:04:26.379765 2017] [mpm_prefork:notice] [pid 4059] AH00169: caught SIGTERM, shutting down</p>
  </blockquote>
  
  <p>I've spent several hours looking at similar topics on stackoverflow as well as other sources but to no avail. I am fairly new to all of this as well and thus I'm not overly clued up on a lot of the terminology. From my understanding (whatever little it may be), it may be something to do with a bad module or php7 not linking up properly ? </p>
  
  <p>I am using apache version: </p>
  
  <pre><code>Server version: Apache/2.4.23 (Unix)
  Server built:   Aug  8 2016 16:31:34
  php version 7.1.1
  </code></pre>
  
  <p>and configtest gives me the following:</p>
  
  <blockquote>
    <p>AH00112: Warning: DocumentRoot [/usr/docs/dummy-host.example.com] does not exist
    AH00112: Warning: DocumentRoot [/usr/docs/dummy-host2.example.com] does not exist
    Syntax OK</p>
  </blockquote>
  
  <p>Any advice would greatly be appreciated. Completely gassed out on what to do next :( </p>