title: Apache 2.4 PHP Startup: Unable to load dynamic library 'curl.so', libcurl.4.dylib
body: <p>I'm running <em>macOS 10.12</em>, <em>Apache 2.4</em>, and <em>PHP 7.2.7</em></p>
  
  <p>When I add the line: LoadModule php5_module <code>libexec/apache2/libphp5.so</code>
  to my <em>httpd.conf</em> I get the following errors.</p>
  
  <pre><code>httpd not running, trying to start
  </code></pre>
  
  <blockquote>
    <p><b>Warning</b>:  PHP Startup: Unable to load dynamic library 'curl.so'
    (tried:
    /usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/curl.so
    (dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/curl.so,
    9): Library not loaded: /usr/local/php5/lib/libcurl.4.dylib<br>
    Referenced from:
    /usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/curl.so<br>
    Reason: Incompatible library version: curl.so requires version 9.0.0
    or later, but libcurl.4.dylib provides version 7.0.0),
    /usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/curl.so.so
    (dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/curl.so.so,
    9): image not found)) in <b>Unknown</b> on line <b>0</b></p>
    
    <p><b>Warning</b>:  PHP Startup: Unable to load dynamic library
    '/usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/http.so'
    (tried:
    /usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/http.so
    (dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/http.so,
    9): Library not loaded: /usr/local/php5/lib/libcurl.4.dylib<br>
    Referenced from:
    /usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/http.so<br>
    Reason: Incompatible library version: http.so requires version 9.0.0
    or later, but libcurl.4.dylib provides version 7.0.0),
    /usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718//usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/http.so.so
    (dlopen(/usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718//usr/local/php5/lib/php/extensions/no-debug-non-zts-20170718/http.so.so,
    9): image not found)) in <b>Unknown</b> on line <b>0</b></p>
  </blockquote>
  
  <p><br /></p>
  
  <pre><code>/usr/sbin/apachectl: line 92:   719 Segmentation fault: 11  $HTTPD "$@"
  </code></pre>
  
  <p>I updated curl with brew and it shows:</p>
  
  <pre><code>/usr/local/php5/lib/libcurl.4.dylib (compatibility version 9.0.0, current version 9.0.0)
  </code></pre>
  
  <p>I still get the same error.</p>
  
  <p>Why is the error showing libcurl.4.dylib provides version 7.0.0 when it is version 9.0.0? Is it pointing to an older version of the file? They both show this location <code>/usr/local/php5/lib/libcurl.4.dylib</code></p>
  
  <p>Thanks for your help.</p>