dyld[45923]: Library not loaded: /usr/local/opt/libavif/lib/libavif.15.dylib – Macos

by
Maya Patel
composer-php homebrew macos xampp

Quick Fix: To resolve this issue, reinstall the gd library using the ‘brew reinstall gd’ command in your terminal. This will update or replace any corrupted or missing files associated with gd, potentially fixing the library loading issue.

The Problem:

After updating macOS to Sonoma, XAMPP is showing an error: ‘dyld[45923]: Library not loaded: /usr/local/opt/libavif/lib/libavif.15.dylib’. Reinstalling XAMPP did not resolve the issue. The user is unable to use PHP and Composer due to this error.

The Solutions:

Solution 1: Reinstall gd

If you encounter the error message “dyld[45923]: Library not loaded: /usr/local/opt/libavif/lib/libavif.15.dylib” after updating macOS or reinstalling XAMPP, you can try the following solution:

  1. Open Terminal on your Mac.
  2. Run the following command to reinstall gd:
  3. brew reinstall gd
    
  4. This command will reinstall the gd library, which may resolve the issue.

Solution 2: Use brew commands to resolve the issue

To resolve the error, follow these steps:

  1. Update the Homebrew repository by running:
brew update
  1. Run a cleanup command to remove any outdated or unused packages:
brew cleanup
  1. Finally, upgrade to the latest version of Homebrew packages:
brew upgrade
  1. After completing these steps, the error should be resolved, and you should be able to use PHP and Composer as expected.

Solution 3: Update outdated packages

If you are encountering a “Library not loaded” error, it’s possible that the issue may be caused by outdated packages on your system. To resolve this, you can try updating your packages using the following steps:

  1. Open a terminal window or command prompt.
  2. Run the following command to update all outdated packages:
  3. brew update
    
  4. Once the update process is complete, try running your PHP or Composer commands again to see if the error has been resolved.

Q&A

How to solve the error "Library not loaded: /usr/local/opt/libavif/lib/libavif.15.dylib"?

Try to reinstall gd: "brew reinstall gd".

What are the steps to fix this error?

Try to run "brew update" and "brew upgrade".

What is the cause of this error?

Outdate packages on macOS workstation.