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

MMC EX Logo

i've been searching for this logo for quite sometime now. and i got tired of it. so, i decide to create one. took a snap at my lancer grill and with the use of trusty ol' photoshop, viola!!! i just don't know if there are still rights on this. as for me, it's free for every body. if you wanna design a shirt coz youre an old school mitsu fan, then be my guest...cheers!!!

Conversations with Grok (Part 1): Introducing Agile Transportation System

Me: What do you think of agile Transportation System? Grok : It seems like you might be referring to "Agile Transportation System." Did you mean a specific system, like a company, a concept, or something else? I’ll assume you’re asking about agile transportation in a general sense—like how agility applies to transportation systems—and go from there. If I’ve got it wrong, just let me know! Agile transportation typically refers to a flexible, responsive approach to moving goods or people. Think of it as a system that can quickly adapt to changes—whether that’s shifting demand, unexpected delays, or new tech. In practice, it’s about efficiency and speed without sacrificing reliability. For example, logistics companies might use real-time data to reroute trucks around traffic, or cities could tweak public transit schedules based on passenger patterns. It’s all about staying nimble in a world where disruptions—like weather, supply chain hiccups, or even pandemics—can throw a wrenc...

recipe: pinesang itlog (souped egg)

i love to eat and cook. so, i always stay in the kitchen to get the first taste on any food cooked by my mom. eventually, i learned some of them. and here's one: pinesang itlog ingredients: 5 thick slices ginger 2 cloves garlic 1/2 bulb onion, diced 5 tablespoon fish sauce (patis) 1-3 eggs pechay/dahong sibuyas half liter water directions: suate garlic till brown. add onion and ginger. pour fish sauce and let sizzle. add water. let it boil for 5 minutes. add the vegetables. let it boil for 2 minutes. add eggs and let boil for few minutes till the eggs harden. serve and enjoy!