2017-08-01 94 views
1

我一直在更新我的网站到PHP 7.1.7以及IIS,并遇到了imagecreatetrucolor抛出500错误的问题。PHP 7.1.7 imagecreatetruecolor产生500错误

http://localhost/test.php 500 (Internal Server Error) 

的代码在该文件中唯一的行

<?php imagecreatetruecolor(10,10) ?> 

这已经在现场一直致力于PHP 31年6月5日和Apache下,返回

resource(2) of type (gd) 

GD成像上市in with phpinfo()under 7.1.7 as

GD imaging Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger 

这是错误

Fatal error: Uncaught Error: Call to undefined function imagecreatetruecolor() in D:\Intranet\www\public\test.php:11 Stack trace: #0 {main} thrown in D:\Intranet\www\public\test.php on line 11 

问题是什么?

+1

打开你的错误,从你的ini文件报告,看看有什么错误! –

+0

这是错误 致命错误:未捕获错误:调用D:\ Intranet \ www \ public \ test.php中的未定义函数imagecreatetruecolor():11 Stack trace:#0 {main}抛出D:\ Intranet \ www \ public \ test.php第11行 –

+0

所以你的函数没有定义! –

回答

1

基于您的评论确保您已经安装php7.1-gd并启用

退房这个答案可能是有帮助的 call-to-undefined-function-imagecreatetruecolor

+0

具体而言,我不得不在php.ini中取消对extension = php_gd2.dll的注释。我还必须取消注释extension = php_exif.dll才能够使用文件中的exif数据,以确保该网站继续按照原样工作。 感谢您的帮助。 –

+0

@PaulNeale不客气!很高兴帮助你:) –