Resolve fatal error: uncaught error: class’ imageick ‘not found
reason
PHP requires the imageick extension to be installed
environment
CentOS Linux release 7.9
PHP 7.3.26
Installation steps
Download the appropriate ImageMagick program and ImageMagick extension according to the environment
Installing imagemagic
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
tar zxvf ImageMagick.tar.gz
cd ImageMagick-7.1.0-8/
./configure --prefix=/usr/local/webservice/imagemagick
make && make install
Check whether the installation is successful
/usr/local/webservice/imagemagick/bin/convert -version
Version: ImageMagick 7.1.0-8 Q16-HDRI x86_64 2021-09-18 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(3.1)
Delegates (built-in): fontconfig freetype jng jpeg lzma png x xml zlib
Compiler: gcc (4.8)
Installing the PHP extension: imagick
Download address
https://pecl.php.net/package/imagick
View the appropriate version download
wget https://pecl.php.net/get/imagick-3.5.1.tgz
tar zxvf imagick-3.5.1.tgz
cd imagick-3.5.1/
/usr/local/webservice/php73/bin/phpize
./configure --with-php-config=/usr/local/webservice/php73/bin/php-config --with-imagick=/usr/local/webservice/imagemagick
make && make install
Successful installation is displayed
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/webservice/php73/lib/php/extensions/no-debug-zts-20180731/
Installing header files: /usr/local/webservice/php73/include/php/
Modify the configuration file and write extension=imagick.so
Add
extension=/usr/local/webservice/php73/lib/php/extensions/no-debug-zts-20180731/imagick.so at the end of vim /usr/local/webservice/php73/etc/php.ini
Restart php-fpm and test whether the installation is successful
systemctl restart php-fpm
php -m | grep imagick
Read More:
- [Solved] PHP Fatal error: Uncaught Error: Class ‘Redis‘ not found in
- Mac PHP Fatal error: Class ‘Memcache’ not found
- [Solved] Fatal error: Class ‘think\Container‘ not found & [InvalidArgumentException] Could not find package
- Mac installs the php Swoole extension and appears Enable openssl support, require openssl library or fatal error:’openssl/ssl.h’ file not found
- [Solved] PHP Fatal error: Uncaught Elasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes
- [Solved] Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 60
- [Solved] Laravel admin Error: Symfony\Component\Debug\Exception\FatalThrowableError : Class ‘Doctrine\DBAL\Driver\PDOMySql\Driver’ not found
- PHP error in Windows: class’ mysqli ‘not found
- [Solved] WordPress Upgrade PHP 5.6 to 7.x Fatal error: Uncaught Error: Call to undefined function mysql_connect()
- Error while injecting dependencies into App\Controller\IndexController: No entry or class found for
- [Solved] PostgreSQL configure: error: readline library not found
- [PHP] __autoload function will be called when class_exists does not exist
- laravel The Process class relies on proc_open, which is not available on your PHP installation.
- PHP Error Object of class mysqli could not be converted to string in
- PHP php-config is not installed error in ubuntu 16 [How to Solve]
- [PHP] php8 jit does not support 32-bit systems WARNING: JIT not supported by host architecture
- [WordPress Error] Fatal error undefined function is_network_admin()
- Fatal error: Function name must be a string in
- How to Solve PHP Error: no package’oniguruma’ found
- How to Solve PHP Fatal error: Namespace declaration statement has to be the very first statement