Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii 2 giving an exception when clicking on the default contact tab

Tags:

php

yii

yii2

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

like image 315
J_Strauton Avatar asked Aug 04 '15 15:08

J_Strauton


1 Answers

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
like image 171
meysam Avatar answered Oct 21 '22 15:10

meysam