PHP - Unable to load dynamic library gd

While setting up the Comment plugin provided with WolfCMS, I ran into an issue where the captcha was not being rendered. After a little sniffing around, I began to suspect there was an issue with the gd module in my PHP installation. Running php -v (or looking in the logs) showed the following errors:

PHP Warning:  PHP Startup: Unable to load dynamic library '/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 '/usr/lib/php/modules/json.so' - /usr/lib/php/modules/json.so: cannot open shared object file: No such file or directory in Unknown on line 0

The output indicated PHP was failing to load the json.so and gd.so PHP modules. The json.so issue was resolved easily after reading the following Arch news announcement:

which called for removal of the 'extension=json.so' line entirely as json had been built into PHP and thus the module was no longer required. Getting back to the main problem with gd - first course of action was to verify that the following line in my php.ini file was uncommented, and indeed it was:

extension=gd.so

This issue was resolved by installing the following:

package from the extra repository. After restarting httpd the captcha on Wolf's Comment plugin began functioning correctly. I have since moved to disqus for comments, but this was a helpful exercise nonetheless.

Unfortunately in the time since writing this post, the Arch linux package link has gone dead. Instead maybe try:

Tags

 Linux  PHP  LAMP