title: Can't open PHP, dyld: Library not loaded
body: <p>I am aware there are many other questions related to this error, but I have tried all the answers and nothing worked.</p>
  
  <p><strong>Full error</strong></p>
  
  <pre><code>dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
  Referenced from: /usr/local/opt/php@7.1/bin/php
  Reason: image not found
  Abort trap: 6
  </code></pre>
  
  <p><strong>When did the error occur?</strong></p>
  
  <p>Right after updating Ruby to 2.6.3 via RVM.</p>
  
  <p>Whenever I enter "php" into the terminal the error appears.</p>
  
  <p><strong>Steps taken</strong></p>
  
  <ul>
  <li>Basic steps: Restart Macbook, opened new terminal window.</li>
  <li>Uninstall/Reinstall: Node, Openssl, libpng, Ruby</li>
  <li>Update/Upgrade: brew</li>
  <li>Unlinked/Linked: libidn, autoconf</li>
  <li>Given myself all rights via chown -R /usr/local</li>
  <li>OpenSSL: $ sudo rm /usr/bin/openssl, brew reinstall openssl@1.1</li>
  <li>Brew cleanup</li>
  <li>Reinstalled PHP</li>
  </ul>
  
  <p><strong>Versions</strong></p>
  
  <ul>
  <li><p>Mac OS Mojave 10.14.6</p></li>
  <li><p>PHP 7.4</p></li>
  <li>Ruby 2.6.3p62</li>
  <li>RVM 1.29.9</li>
  </ul>
  
  <p><strong>When running Brew Doctor</strong></p>
  
  <pre><code>Please note that these warnings are just used to help the Homebrew maintainers
  with debugging if you file an issue. If everything you use Homebrew for is
  working fine: please don't worry or file an issue; just ignore this. Thanks!
  
  Warning: "config" scripts exist outside your system or Homebrew directories.
  `./configure` scripts often look for *-config scripts to determine if
  software packages are installed, and which additional flags to use when
  compiling and linking.
  
  Having additional scripts in your path can confuse software installed via
  Homebrew if the config script overrides a system or Homebrew-provided
  script of the same name. We found the following "config" scripts:
    /opt/local/bin/python2.7-config
    /opt/local/bin/curl-config
    /opt/local/bin/ncursesw6-config
    /opt/local/bin/pcre-config
    /opt/local/bin/ncurses6-config
    /opt/local/bin/pcap-config
  
  Warning: Unbrewed header files were found in /usr/local/include.
  If you didn't put them there on purpose they could cause problems when
  building Homebrew formulae, and may need to be deleted.
  
  Unexpected header files:
  (here it posts all the /usr/local/include/node files, but the list exceeds character limitations)
  </code></pre>
  
  <p>Any ideas on how to solve this error?</p>