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

Two Questions to Simplify Your Life

The art of war, then, is governed by five constant factors, to be taken into account in one's deliberations, when seeking to determine the conditions obtaining in the field.   The Art Of War - Sun Tzu Chapter 1: Number 3 In making decisions, one has to consider a lot of factors. In short everything needs to be considered. In the book The Art of War, there are five constant factors: The Moral Law Heaven Earth The Commander Method and discipline Which means a lot of thinking and doing is involve. I'm lazy and I hate big tasks. I don't want to make long decision making. I want them done immediately, accurately and fast. And so, I have to just simplify the problem. Once the problem is identified, ask these questions: Is it Urgent? Is it Important? Sample: You were given 10 things to deal with and they want you to make a decision in 2 minutes. Go through each of them and ask "Is this urgent?". In the end you have divided them in two - urg...

dedon island resort, philippines amongst the dream hotel to visit before you die

from matadornetwork.com (which is also credited for the picture below), found, i, the 48 epic dream hotel to visit before you die  which, i would say, is worth reading (and watching the pictures). what hit me though is the dedon island resort: a resort in my own country which i didn't even know existed. so, without further ado - DEDON ISLAND RESORT

Using AI to Reinvent My Résumé and Try to Land an Interview

Creating a résumé is a tedious job to most. It's hard, time consuming and might even be the cause for rejection-if you don't know what you're doing. Fortunately, there are AI tools out there that created to assist, us humans, in generating résumé. It save's time, effort and you get higher chance of being hired.  But what if you're transitioning to an entirely different role? You don't have experience, no educational background to back it up. and no portfolio to show. What do you do? You come up with something creative. You come up with some that has never been done before. And, just wow them... or at least try. I was messaged in LinkedIn for a position that I was eyeing for in years. The HR guy reached out and we scheduled a call interview. We talked for more than half an hour and I was enlightened that my résumé is lack-luster. I was highly considered but the résumé is not at par because I have no job experience on AI, the certifications we're not included,...