OSX 下 UCenter 登录验证码无法显示

发布于 2022-08-31 20:46:23 字数 1084 浏览 10 评论 0

lib/seccode.class.php

if(function_exists('imagepng')) {
  header('Content-type: image/png');
  imagepng($this->im);
} else {
  header('Content-type: image/jpeg');
  imagejpeg($this->im, '', 100);
}

其中这一行

imagejpeg($this->im, '', 100);

返回的结果是 action not found

版本:UCenter_1.6.0_SC_UTF8


执行 gd_info() 结果

Array ( [GD Version] => bundled (2.1.0 compatible) [FreeType Support] => [T1Lib Support] => [GIF Read Support] => 1 [GIF Create Support] => 1 [JPEG Support] => 1 [PNG Support] => [WBMP Support] => 1 [XPM Support] => [XBM Support] => 1 [JIS-mapped Japanese Font Support] => )

终于解决了,我之前使用的是 osx 自带的 php,是 5.5,我今天升级了 5.6 然后就好了。

brew install php56
brew unlink php55
brew link php56

brew install freetype jpeg libpng gd zlib
brew install php56-imagick

cp /usr/local/Cellar/php56/5.6.3/libexec/apache2/libphp5.so /usr/libexec/apache2/libphp5.so

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

肩上的翅膀 2022-09-07 20:46:24

imagejpeg这个方法存在吗?你用function_exists检测一下。

桃气十足 2022-09-07 20:46:24

imagejpeg($this->im, '', 100);

改为

imagejpeg($this->im, null, 100);

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文