Yii 2 在单击默认联系人选项卡时出现异常 [英] Yii 2 giving an exception when clicking on the default contact tab

查看:20
本文介绍了Yii 2 在单击默认联系人选项卡时出现异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 localhost 在我的 mac 上运行时出现此错误.

<块引用>

支持 FreeType 的 GD PHP 扩展或 ImageMagick PHP需要支持 PNG 的扩展.

我认为问题出在联系页面上默认呈现的 PNG 图片.所有代码都是 Yii 框架给出的基本代码:

解决方案

为了解决问题,首先在你的系统上安装 php-gd 模块.然后在编辑器上打开 php.ini 并搜索 ;extension=gd.so 并删除标题 ; 符号.然后重启你的 apache 服务 ;).

对于 Arch Linux,您可以执行以下操作(以 # 开头的行是终端命令):

  • # pacman -S php-gd
  • # vim/etc/php/php.ini
  • /并输入gd然后按Enter
  • 找到;extension=gd.so,将光标移动到;符号上,然后按将其转换为extension=gd.so>x
  • Esc 并输入 :wq 并按 Enter
  • # systemctl restart httpd.service

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.

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.

解决方案

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

这篇关于Yii 2 在单击默认联系人选项卡时出现异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆