Software Engineering in WordPress, PHP, and Backend Development

Category: Notes (Page 3 of 49)

Notes on programming-related problems that I’ve encountered while working on various projects.

Quick Fix: Module ‘imagick’ already loaded

When working with multiple version of PHP installed via Homebrew, there’s a chance you’ll encounter error messages like this:

PHP Warning: Module 'imagick' already loaded in Unknown on line 0
PHP Warning: Version warning: Imagick was compiled against Image Magick version 1809 but version 1808 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0

Granted, the version number may be different but the rest of the message will be the same. When I’ve experienced this, it’s when I’ve a set up like this:

  • I have multiple versions of PHP installed (anything from the earliest build in 7 up to the latest version in 8),
  • I swap among versions in my ~/.zshrc file depending on the project,
  • When I attempt to run code that’s on an older version of PHP after installing and using the newer or latest version of PHP, I see the above error.

To fix this, there are two things you can do:

  1. Locate the version of the php.ini file for the version of PHP you’re currently using,
  2. Update the php.ini file for the version to disable the version check on Imagick.
Continue reading

Fix: 502 Bad Gateway with Valet

Periodically, I’ll be trying to load a development using Valet and I’ll end up getting 502 Bad Gateway error.

Whenever I’m faced with this problem, here are the following steps I do to restore functionality (without breaking any of my existing links or certificates):

  1. Run $ composer global update
  2. Run $ valet install
  3. Run $ valet restart

The last step isn’t always necessary but I’ve found there are times where I’ve had to use it.


For reference, check out the past articles related to the above content:

Happy Thanksgiving

Despite the fact that I don’t know how many people read this the day it’s published – or that it matters, really – I’ve almost always shared a note of thanks on Thanksgiving Day on this site for just about as long as I’ve been writing on this blog.

Why would I stop this year?

Continue reading
« Older posts Newer posts »

© 2024 Tom McFarlin

Theme by Anders NorenUp ↑