adjustfocus

TFOL Dev Story #1

December 25, 2025

When “Just Install Imagick” Revealed How Linux Really Works

theFocusOnLife · Development · Ubuntu · PHP · Problem Solving


Installing Imagick on Ubuntu should be simple.
On a LAMPP-based local server, it turned into a lesson about shared libraries, hidden dependencies, and how software actually runs at runtime.

This TFOL Dev Story documents how a routine task exposed a deeper systems issue — and how careful, methodical debugging solved it without reinstalling anything.


The Goal: Better Image Handling on TFOL

TheFocusOnLife (TFOL) relies heavily on images. To improve image resizing quality and consistency, I decided to use Imagick as the primary image-processing engine, with GD as a fallback.

The environment:

  • Ubuntu desktop

  • LAMPP (Apache + PHP)

  • TFOL running locally for development

The task sounded routine:

Install Imagick, enable it in PHP, move on.

It didn’t turn out that way.


The First Problem: “Imagick Not Loaded”

After installing ImageMagick and the PHP Imagick extension:

  • phpinfo() showed no Imagick section

  • A browser test script returned:
    “Imagick not loaded”

Yet package managers reported success.

This revealed the first important truth:

Software can be correctly installed and still not work — because installation is not execution.


The Hidden Variable: Multiple PHP Versions

Digging deeper exposed an important mismatch:

  • Ubuntu system PHP: 8.3

  • LAMPP PHP (used by Apache / TFOL): 8.1

Imagick had initially been installed for the wrong PHP.

After rebuilding Imagick correctly for LAMPP’s PHP, the extension still refused to load.

That meant the real problem was deeper.


The Error That Mattered

Eventually, PHP reported this warning during startup:

 
 
undefined symbol: FT_Done_MM_Var

This wasn’t a PHP error.
It wasn’t an Imagick error.

It was a shared library symbol resolution failure — the kind that only appears when multiple versions of low-level system libraries collide.

At that point, the question changed from:

“Why isn’t Imagick loading?”

to:

“What is the system actually loading at runtime?”


Why Standard Checks Failed

Traditional tools gave misleading reassurance:

  • Dependency checks looked fine

  • Required libraries existed

  • No missing files were reported

Everything appeared correct.

This is where many developers stop.

Instead, I used runtime linker tracing — asking Linux to show exactly which libraries were being loaded in real time.


The Root Cause: LAMPP’s Bundled Libraries

Runtime diagnostics revealed the real issue:

LAMPP includes its own copies of common shared libraries inside /opt/lampp/lib.

One of those was FreeType, an older version that lacked the symbol required by modern system libraries.

So the system was doing this:

  • Loading new system libraries

  • Binding them against old bundled LAMPP libraries

  • Failing only at runtime, when symbols were resolved

Nothing was “broken.”
The pieces simply didn’t belong together.


The Fix: Minimal, Safe, and Reversible

No reinstallations were required.

The solution was to prevent LAMPP from using its outdated internal libraries so it would fall back to the system versions.

I did this by renaming (not deleting) the bundled libraries and restarting LAMPP.

Immediately:

  • Imagick appeared in phpinfo()

  • A test image rendered correctly

  • TFOL could use Imagick as intended


What This Dev Story Reinforced

1. Runtime truth beats configuration assumptions

What loads matters more than what should load.

2. Complex systems fail quietly

The most dangerous bugs don’t announce themselves clearly.

3. Methodical debugging outperforms trial-and-error

Each step narrowed the problem until only one explanation remained.

4. Understanding scales — guesswork doesn’t

Now this fix is permanent, documented, and repeatable.


Why This Is a TFOL Story

TheFocusOnLife isn’t just about outcomes.
It’s about process, patience, and learning through friction.

This wasn’t just an Imagick install.
It was a reminder that:

The deeper the system, the more it rewards calm, curiosity, and respect.


Looking Ahead: TFOL Dev Stories

This post launches a recurring series:

TFOL Dev Stories — real problems, real debugging, real lessons.

Future entries may include:

  • Migrating TFOL between hosting environments

  • Image naming and database integrity

  • Backup strategies that actually work

  • When “small refactors” turn into architectural decisions

Each story documents:

  • The original intent

  • The unexpected obstacle

  • The reasoning that solved it

Posted in tfol-dev-stories by TFOL BLOG

Comments