DEV Community

Ibrar Hussain
Ibrar Hussain

Posted on • Edited on

7 2

How to fix - dyld: Library not loaded

Today, I needed to setup Laravel 8 and for that purpose I want to install php version 7.4 at the very least. As, I am using Laravel Valet on my MacBook, so I tried to install it via the following command:



valet use php@7.4


Enter fullscreen mode Exit fullscreen mode

but after some time, I got some error and after that no matter what command: composer, php, valet etc I tried and each time I got the following error:
dyld: Library not loaded error message

After googling for a while, found that there is not proper fix for this one but I have remove all the existing php versions and re-install it again.

So, I started by removing all the existing php versions (7.2, 7.3 & 8) via the following command:



sudo rm -rf /usr/local/Cellar/php@7.2


Enter fullscreen mode Exit fullscreen mode

and repeated the same steps for php version 7.3 and 8 as well.

Next, install the required php versions again via the following command:

For Mac with ARM


arm brew install php@7.2


Enter fullscreen mode Exit fullscreen mode
For Mac without ARM


brew install php@7.2


Enter fullscreen mode Exit fullscreen mode

Repeat the same steps for any other php versions you want to install.

Now, restart Valet and with this you are back on track.

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more