11

I am getting this error when I run on my mac with localhost.

Either GD PHP extension with FreeType support or ImageMagick PHP extension with PNG support is required.

enter image description here

I think the problem comes with the PNG picture that is being rendered by default on the contact page. All of the code is the basic code that is given by the Yii framework: here Only happens when I click the Contact tab on the navigation bar.

enter image description here

2

8 Answers 8

18

For solve problem, first install php-gd module on your system. After that open php.ini on your editor and search for ;extension=gd.so and remove the heading ; sign. Then restart your apache service ;).

For Arch Linux you can do followings (Lines that begins with # are command of terminal):

  • # pacman -S php-gd
  • # vim /etc/php/php.ini
  • Press / and type gd then press Enter
  • Find ;extension=gd.so and convert it into extension=gd.so by moving cursor on ; sign and press x
  • Press Esc and type :wq and press Enter
  • # systemctl restart httpd.service
5

With this two lines it is okeyokay:

sudo apt install php-gd

sudo service apache2 restart
1

As suggested in the comments.

The contact form contains a .png picture in the form of a captcha image. The captcha image is used there to prevent spam being send via the contact form.

  • You can edit the view page and remove the captcha
  • You can install php-gd or php-imagick extension
0

Instead of using the latest version I tried downloading ImageMagick-6.7.7-5-Q16-windows-dll from here. That one actually worked with the php_imagick.dll (Imagick for PHP 5.5.x) from http://www.peewit.fr/imagick/.

This is not the latest version but it worked. (even without restarting the computer)

0

Infact in Windows 10 environment, installed with WAMP Server, it was a matter of copying php.ini file to C:\wamp64\bin\apache\apache2.4.27\bin\

It was missing at that location.

0

Try un-commenting extension=gd2 in php.ini. Then restart apache.

0

On windows, if you already install php > 7.0, then Check php_gd2.dll is in your extension directory and uncomment ;extension=gd2 of your php.ini.

1
  • 1
    windows, default php.ini file is comment this gd extension, so we only need to uncomment and restart php-fpm process.
    – Mr C
    Commented Nov 5, 2020 at 13:55
0

Uncomment the extension=gd and restart dev server with command php yii serve

restarting apache server from xampp control won't help

1
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Mar 21, 2023 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.