Php 致命错误:调用未定义的函数imagefilter()
是什么导致了这个错误 Fatal error: Call to undefined function imagefilter() in /var/www/polaroid.php on line 5Php 致命错误:调用未定义的函数imagefilter(),php,image-processing,gd,imagefilter,Php,Image Processing,Gd,Imagefilter,是什么导致了这个错误 Fatal error: Call to undefined function imagefilter() in /var/www/polaroid.php on line 5 谢谢 您使用的是什么版本的PHP?看起来imagefilter是一个PHP5函数 编辑: 您的代码可以在我的PHP版本上运行。以下是我的phpinfo供参考: gd GD Support enabled **GD Version bundled (2.0.34 compatible)** F
谢谢 您使用的是什么版本的PHP?看起来imagefilter是一个PHP5函数 编辑: 您的代码可以在我的PHP版本上运行。以下是我的phpinfo供参考:
gd
GD Support enabled
**GD Version bundled (2.0.34 compatible)**
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
您可能需要确保GD版本已绑定。我见过一些安装说GD支持已启用,但没有捆绑。但不确定这是否会产生影响。您使用的是什么版本的PHP?看起来imagefilter是一个PHP5函数 编辑: 您的代码可以在我的PHP版本上运行。以下是我的phpinfo供参考:
gd
GD Support enabled
**GD Version bundled (2.0.34 compatible)**
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
您可能需要确保GD版本已绑定。我见过一些安装说GD支持已启用,但没有捆绑。但是,不确定这是否有区别。imagefilter似乎只有在PHP被编译为绑定的GD库时才可用,而在您的情况下,它不是(这就是绑定和启用的区别)。因为您使用的是Ubuntu,所以您在存储库中找到的php版本没有绑定GD。imagefilter似乎只有在php根据绑定GD库编译时才可用,而在您的情况下,它不是(这就是绑定和启用的区别)。因为您使用的是Ubuntu,所以在存储库中找到的php版本没有绑定GD。有一个通知: 注意:只有使用 GD库的捆绑版本 有一个通知: 注意:只有使用 GD库的捆绑版本
正如2016年的更新一样,PHP5.3允许使用外部GD,但由于某些原因,在lucid/precise中无法使用。trusty使用PHP5.5时,除了imageantialias、source(和以前的注释)之外,所有这些图像函数都可以正常工作。正如2016年的更新一样,PHP5.3允许使用外部GD,但由于某些原因,在lucid/precise中无法正常工作。trusty在PHP5.5中,除了imageantialias、source(和以前的注释)之外,所有这些图像函数都可以工作。因此我假设调用函数_exists('imagefilter')返回false,correct?correct。不过谢谢你。我不知道函数_exists()您能显示phpinfo()的gd部分吗?您看到“GD版本捆绑(2.0.34兼容)”了吗?我知道有些人只看到“GD支持启用”,但他们没有一行字,上面写着版本是捆绑的。不是捆绑的!我们可能发现了什么。。。知道如何更改吗?不确定,但在php.net for imagefilter的注释中,它说“注意:只有使用捆绑版本的GD库编译php时,此函数才可用。”所以我确实认为这是问题所在;它必须捆绑起来。也许尝试一个新的安装?抱歉,不确定您还可以做什么。所以我假设调用函数_exists('imagefilter')返回false,对吗?对。不过谢谢你。我不知道函数_exists()您能显示phpinfo()的gd部分吗?您看到“GD版本捆绑(2.0.34兼容)”了吗?我知道有些人只看到“GD支持启用”,但他们没有一行字,上面写着版本是捆绑的。不是捆绑的!我们可能发现了什么。。。知道如何更改吗?不确定,但在php.net for imagefilter的注释中,它说“注意:只有使用捆绑版本的GD库编译php时,此函数才可用。”所以我确实认为这是问题所在;它必须捆绑起来。也许尝试一个新的安装?对不起,我不知道你还能做什么。
gd
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.3.7
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
gd
GD Support enabled
**GD Version bundled (2.0.34 compatible)**
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.9
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled