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

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

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

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

改为

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


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

【热门文章】
【热门文章】