skip to Main Content

I am on High Sierra 10.13.6 and I recently ran into an issue with my Homebrew environment for local dev work. I can’t seem to figure out what is the problem. Any Composer or Drush commands will give this

dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
  Referenced from: /usr/local/bin/php
  Reason: image not found
Abort trap: 6

I restarted my computer and when I try to start apachectl; I get

httpd: Syntax error on line 179 of /usr/local/etc/httpd/httpd.conf: Cannot load /usr/local/Cellar/php71/7.1.12_23/libexec/apache2/libphp7.so into server: dlopen(/usr/local/Cellar/php71/7.1.12_23/libexec/apache2/libphp7.so, 10): Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylibn  Referenced from: /usr/local/Cellar/php71/7.1.12_23/libexec/apache2/libphp7.son  Reason: image not found

I think this is because the path is looking for openssl, but in the Brew list, I don’t have openssl anymore, it is now [email protected]

Bash profile has the following:

export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

$which openssl returns

/usr/local/opt/[email protected]/bin/openssl

What can I do to resolve this? Maybe I’m missing the obvious.

2

Answers


  1. Chosen as BEST ANSWER

    So in case anyone runs into this. I managed to fix this myself.

    First I commented out the following line in my usr/local/etc/httpd/httpd.conf file

    LoadModule php7_module        /usr/local/Cellar/php71/7.1.12_23/libexec/apache2/libphp7.so
    

    Next I ran

    $brew install [email protected]
    

    I added the following lines to .bash_profile

    export PATH="/usr/local/opt/[email protected]/bin:$PATH"
    export PATH="/usr/local/opt/[email protected]/sbin:$PATH"
    

    Then added the following line to usr/local/etc/httpd/httpd.conf file

    LoadModule php7_module         /usr/local/Cellar/[email protected]/7.3.13/lib/httpd/modules/libphp7.so
    

    Then I restarted my computer then ran

    $brew services start [email protected]
    $brew services restart httpd
    $sudo apachectl -k restart 
    

    Then I had some sql connection issues.

    $brew upgrade mariadb 
    $brew services restart mariadb
    $brew services restart httpd
    $sudo apachectl -k restart 
    

    And everything came together. Hope this helps.


  2. If that helps somebody else not willing to reinstall PHP:

    ln -s /usr/local/Cellar/openssl/1.0.2s/lib/libcrypto.1.0.0.dylib /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
    ln -s /usr/local/Cellar/openssl/1.0.2s/lib/libssl.1.0.0.dylib /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search