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:
- Open Terminal on your Mac.
- Run the following command to reinstall gd:
- This command will reinstall the gd library, which may resolve the issue.
brew reinstall gd
Solution 2: Use brew commands to resolve the issue
To resolve the error, follow these steps:
- Update the Homebrew repository by running:
brew update
- Run a cleanup command to remove any outdated or unused packages:
brew cleanup
- Finally, upgrade to the latest version of Homebrew packages:
brew upgrade
- 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:
- Open a terminal window or command prompt.
- Run the following command to update all outdated packages:
- Once the update process is complete, try running your PHP or Composer commands again to see if the error has been resolved.
brew update
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.