We help IT Professionals succeed at work.

PHP Warning Startup Error - Unable to load dynamic library

i just upgrade my php from 5.3 to 5.4. when i type php -v i get the following error:

[root@server extensions]# php -v
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/imagick.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.4.39 (cli) (built: Apr 16 2015 14:12:04)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

[root@server extensions]# php -m
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/imagick.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

[Zend Modules]


imagick.so is located in /usr/local/lib/php/extesions/no-debug-non-zts-20090626/ if i rename the directory to no-debug-non-zts-20100525 i get the following error or cp the .so file to that new folder name i get the following error:
[root@server admin]# php -v
PHP Warning:  PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20090626
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0
PHP 5.4.39 (cli) (built: Apr 16 2015 14:12:04)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
Comment
Watch Question

Author

Commented:
i reinstalled the extension, but now i get the error as above.

[root@server bin]# php -v
PHP Warning:  PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20090626
PHP    compiled with module API=20100525
These options need to match
 in Unknown on line 0
PHP 5.4.39 (cli) (built: Apr 16 2015 14:12:04)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
Dave BaldwinFixer of Problems
Most Valuable Expert 2014
Commented:
You have to remove the imagick extension from your 'php.ini' until you can find one that is compiled with the same compiler / API.
i had to recompile imagick.

./configure --with-imagick=/usr/local>
make
make install

which fixed my error.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
Good for you.

Author

Commented:
Thanks for the help dave.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
You're welcome!

Author

Commented:
fixed the error which some troubleshooting.