在树莓派下安装dede,报GD错误。
通过Phpinfo或者php命令知道安装的php7.0-gd没问题。
仔细对比这两篇文章:
文章1:https://blog.csdn.net/ax7399/article/details/78468591
文章2:https://blog.csdn.net/weixin_34055787/article/details/88797638
在修改install文件夹下install.inc.php文件中
function gdversion()
{
//没启用php.ini函数的情况下如果有GD默认视作2.0以上版本
//因为我是ubuntu服务器,没有配置php.ini,所以这里返回的是GD2.0版本,然而我的GD版本为2.1.1,所以手动配置版本号
if(!function_exists('phpinfo'))
{
//if(function_exists('imagecreate')) return '2.0';
if(function_exists('imagecreate')) return '2.1.1';
else return 0;
}
else
{
ob_start();
phpinfo(8);
$module_info = ob_get_contents();
ob_end_clean();
if(preg_match("/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i", $module_info,$matches)) { $gdversion_h = $matches[1]; }
else { $gdversion_h = 0; }
// return $gdversion_h;
return '2.1.1'; ####重点####
}
第一个改点是开头注释那,修改为对应自己的php-gd版本,比如文章1,2的都是2.1.1,我用的是2.2.4
关键第二个改点,最后的return '2.1.1',第一篇文章没有,第二篇有,我按照第二篇的,改为return '2.2.4'
成功。
不用去动php.ini中的内容,只要保证phpinfo可以看到,就说明php-gd已开。