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

Artificial Intelligence Does Not Understand

Artificial Intelligence does not understand, at least not in the way humans mean the word understanding. This is not a criticism of AI’s capability, but a clarification of context. The confusion arises because we collapse multiple meanings of “understanding” into a single, unexamined concept. When AI performs well in language, reasoning, or problem-solving tasks, we intuitively project human comprehension onto it. But this projection ignores a critical distinction: understanding is not a monolith, but is stratified across contexts. Without contextual stratification, discussions about AI intelligence, alignment, and consciousness become incoherent. We argue past each other, using the same word while referring to fundamentally different phenomena.

Conversations with Grok (Part 4): Turning Startup

Be updated and read the previous part here:   Conversations with Grok (Part 3): Partnership Ecosystem and Missing Pieces Me: That's great. Now let's go back to the building the Startup. We got tech, vehicles, investor, space, power, fares and connectivity. What are we missing? Grock : Alright, let’s shift gears and focus on building the startup for this routeless, agile transportation system in BGC, Manila. You’ve got a solid lineup already—tech (Google), vehicles (Toyota), investors (Ayala Land), space (BGC administrator), power (Meralco), fares (GCash/Maya), and connectivity (Smart/Globe). But to turn this into a functional startup, there are still some critical pieces missing. Here’s what we need to add to make it a fully operational business: 1. Leadership & Core Team Right now, we’ve got partners but no one steering the ship. A startup needs:   Founders/CEO: Visionaries to pitch to investors, rally the team, and keep the mission on track—someone with hustle and a...

Survival Shadows: The Informal System That Keeps Society Alive

Survival Shadows emerge wherever the formal world fails to meet human needs. They are not born from crime, greed, or defiance. They rise from necessity. When institutions become too slow, too rigid, too expensive, or too absent, people create their own systems. These systems from lending circles, parallel transport routes, underground labor markets, informal justice to indigenous governance form the real operational backbone of daily life. They are society’s adaptive immune response to state failure. These shadows do not seek power. They seek continuity. They evolve from community instinct, collective memory, and the basic human will to survive. The formal state calls them “informal,” “extralegal,” or “unregulated,” but those labels only reveal how disconnected official institutions are from lived reality. For ordinary citizens, these networks are the actual pathways of access: to cash, to safety, to transport, to judgment, to healing, to connection. The defining test is simple: If rem...