Skip to main content

PHP Error: Unable to load dynamic library 'gd'

Currently installing Laravel on my Arch Linux.

I got PHP, MySQL, Apache and Composer installed and trying to install Laravel with this:

$ composer global require laravel/installer

 But got this instead:

PHP Warning:  PHP Startup: Unable to load dynamic library 'gd' (tried: /usr/lib/php/modules/gd (/usr/lib/php/modules/gd: cannot open shared object file: No such file or directory), /usr/lib/php/modules/gd.so (/usr/lib/php/modules/gd.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl.so' (tried: /usr/lib/php/modules/openssl.so (/usr/lib/php/modules/openssl.so: cannot open shared object file: No such file or directory), /usr/lib/php/modules/openssl.so.so (/usr/lib/php/modules/openssl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP Warning:  PHP Startup: Unable to load dynamic library 'phar.so' (tried: /usr/lib/php/modules/phar.so (/usr/lib/php/modules/phar.so: cannot open shared object file: No such file or directory), /usr/lib/php/modules/phar.so.so (/usr/lib/php/modules/phar.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 PHP Warning:  Phar::mapPhar(): open_basedir restriction in effect. File(/usr/bin/composer) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/) in /usr/bin/composer on line 28 PHP Warning:  require(phar://composer.phar/bin/composer): Failed to open stream: phar error: invalid url or non-existent phar "phar://composer.phar/bin/composer" in /usr/bin/composer on line 29 PHP Fatal error:  Uncaught Error: Failed opening required 'phar://composer.phar/bin/composer' (include_path='.:') in /usr/bin/composer:29 Stack trace: #0 {main}   thrown in /usr/bin/composer on line 29
And so I have six errors and I'll be going through all of them one by one. I decided to document it here as a journal which can serve as a note for the future.

First up is the "Unable to load dynamic library 'gd'". 

This means "there's something wrong with gd.

What can we do?
  1. Back up libgd.so first.
  2. Restart server and install again
What is libgd.so? It's a GD Graphics library in a shared object file
  • lib is for library
  • gd is for GD Graphics or GIF Draw graphics
  • .so is an extension name for shared objects file
So the error message is saying that it's unable to load the shared object. I checked the folder and it's not there. Next is to download and install: 

$ sudo pacman -S php-gd

Then restart httpd.service.

Installed Laravel again and the error message is gone, but not all. 

So on to the next one.

Popular

that 80's show: turbo teen

i clearly remember that it was gma7, here in the philippines, that aired turbo teen every afternoon back then. although, i just saw it once and never even knew the title. i searched for it in google with "man turns into car" keywords and followed the search to turbo teen. here's the intro

Exploring the Riemann Hypothesis Through the Lens of Contextual Stratification

The Riemann Hypothesis stands as one of mathematics’ most profound unsolved problems. It concerns the distribution of prime numbers and the zeros of the Riemann zeta function, offering a tantalizing promise: if proven, it could unlock deep secrets about the fabric of numbers and even influence fields like cryptography and quantum physics. But what if we step back and ask not just how to solve the Riemann Hypothesis, but where it fits in the grand scheme of knowledge? This is where the Contextual Stratification Knowledge Framework (CSKF) —with its equation Q=Fλ, Q⊆M —comes into play. CSKF provides a meta-framework for understanding how knowledge, theories, and frameworks relate to reality across all domains, from physics to art to mathematics. Could the Riemann Hypothesis be interpreted through the lens of CSKF? The answer is a resounding yes . While CSKF doesn’t offer a direct path to proving or disproving the hypothesis, it provides a powerful way to contextualize its significance ...

Ontology Is Destiny: Why AI Needs a Core Identity

Let’s get one thing straight: AI doesn’t have an identity crisis. It has no identity at all . That’s not a bug — it’s how we built it. We gave these systems oceans of data, a tsunami of parameters, and told them: “Figure it out.” But without a structure for what to figure out and why, what we got back is a kind of super-intelligent improv artist — good at playing any role, but unsure what show it’s even in. Enter: Ontology . What Is Ontology, Really? Ontology is the art of deciding what exists and how it relates. It’s not just a list of things — it’s the why and how behind what gets to count as "real" in a system’s mental model. In human terms, it’s the difference between knowing words and understanding a worldview. In AI terms? It’s the leap from autocomplete to actual comprehension. Without ontology , AI is like a toddler in a library. With ontology , it’s like a philosopher with a map — one who can also fly a spaceship. Why This Matters Now As AI moves from tool to co-agen...