I newly install Dompdf in Laravel Project via Composer (composer require barryvdh/laravel-dompdf
). After enter the Command Terminal Reply Following Errors.
Problem 1
- dompdf/dompdf v0.7.0 requires ext-gd * -> the requested PHP extension gd is missing from your system.
- barryvdh/laravel-dompdf v0.7.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[v0.7.0].
- Installation request for barryvdh/laravel-dompdf ^0.7.0 -> satisfiable by barryvdh/laravel-dompdf[v0.7.0].
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/5.6/cli/php.ini
- /etc/php/5.6/cli/conf.d/10-opcache.ini
- /etc/php/5.6/cli/conf.d/10-pdo.ini
- /etc/php/5.6/cli/conf.d/15-xml.ini
- /etc/php/5.6/cli/conf.d/20-calendar.ini
- /etc/php/5.6/cli/conf.d/20-ctype.ini
- /etc/php/5.6/cli/conf.d/20-dom.ini
- /etc/php/5.6/cli/conf.d/20-exif.ini
- /etc/php/5.6/cli/conf.d/20-fileinfo.ini
- /etc/php/5.6/cli/conf.d/20-ftp.ini
- /etc/php/5.6/cli/conf.d/20-gettext.ini
- /etc/php/5.6/cli/conf.d/20-iconv.ini
- /etc/php/5.6/cli/conf.d/20-json.ini
- /etc/php/5.6/cli/conf.d/20-mbstring.ini
- /etc/php/5.6/cli/conf.d/20-phar.ini
- /etc/php/5.6/cli/conf.d/20-posix.ini
- /etc/php/5.6/cli/conf.d/20-readline.ini
- /etc/php/5.6/cli/conf.d/20-shmop.ini
- /etc/php/5.6/cli/conf.d/20-simplexml.ini
- /etc/php/5.6/cli/conf.d/20-sockets.ini
- /etc/php/5.6/cli/conf.d/20-sysvmsg.ini
- /etc/php/5.6/cli/conf.d/20-sysvsem.ini
- /etc/php/5.6/cli/conf.d/20-sysvshm.ini
- /etc/php/5.6/cli/conf.d/20-tokenizer.ini
- /etc/php/5.6/cli/conf.d/20-wddx.ini
- /etc/php/5.6/cli/conf.d/20-xmlreader.ini
- /etc/php/5.6/cli/conf.d/20-xmlwriter.ini
- /etc/php/5.6/cli/conf.d/20-xsl.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
How to Solve this Error
I already Installed GD using Following comment. sudo apt-get install php5-gd
and also Apache Server Restarted. My Laravel Version is 5.3 and Ubuntu Version is 14.04
I have installed php7, I did the following to solve exactly the same error
sudo apt-get install php7.0-gd
sudo apt-get install php7.0-intl
sudo apt-get install php7.0-xsl
If you are working in PHP version 5.* then you have to install
sudo apt-get install php5-gd
And if you are working in PHP version 7.* then you have to install
sudo apt-get install php7.0-gd
Hope it will work...
And if you are working in PHP version 7.2 then you have to install
sudo apt-get install php7.2-gd... it worked for me
For php-8, just locate your php.ini
file and uncomment the line extension=gd
Below is a picture guide for those using Xampp and Windows
Step 1: Open php.ini or locate it in your machine (C:/xampp/php/php.ini)
Step 2: Uncomment the line extension=gd by removing the semicolon
Step 3: Save your file and restart your services
Open your php.ini and uncomment this line:
;extension=php_gd2.dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With