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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
imagejpeg这个方法存在吗?你用function_exists检测一下。
imagejpeg($this->im, '', 100);
改为
imagejpeg($this->im, null, 100);