09/10/2018, 23:49
Về lỗi :Fatal error: Call to undefined function: imagecreate()
Xin các bạn giúp.Khi mình chạy thử một file PHP đơn giản như sau:
<?php
$im = imagecreate(100, 30);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
imagestring($im, 5, 0, 0, "Hello world!", $textcolor);
header("Content-type: image/jpeg");
imagejpeg($im);
?>
Thì có thông báo lỗi:Fatal error: Call to undefined function: imagecreate()
Mình không lắm về GD library, vì vậy rất mong các bạn giải thích.Cám ơn các bạn.
<?php
$im = imagecreate(100, 30);
$bg = imagecolorallocate($im, 255, 255, 255);
$textcolor = imagecolorallocate($im, 0, 0, 255);
imagestring($im, 5, 0, 0, "Hello world!", $textcolor);
header("Content-type: image/jpeg");
imagejpeg($im);
?>
Thì có thông báo lỗi:Fatal error: Call to undefined function: imagecreate()
Mình không lắm về GD library, vì vậy rất mong các bạn giải thích.Cám ơn các bạn.
Bài liên quan
Em làm theo lời bác này, bây giờ không dùng được cả trang PHP luôn hu hu hu
Bây giờ vô trang index.php của em (trước khi làm như trên chỉ bị cái lỗi [red]Fatal error: Call to undefined function: imagecreate()[/red] )
bây giờ thì trang index.php nó ra thế này
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.
For more information as to why this behaviour exists, see the manual page for CGI security.
For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.
e - imagefontheight in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imageinterlace in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imageline in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imageloadfont in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagepolygon in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagerectangle in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagesetpixel in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagestring in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagestringup in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagesx in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagesy in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagedashedline in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagettfbbox in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagettftext in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - imagetypes in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - jpeg2wbmp in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - png2wbmp in Unknown on line 0 PHP Warning: Function registration failed - duplicate name - image2wbmp in Unknown on line 0 PHP Warning: gd: Unable to register functions, unable to load in Unknown on line 0
Trước khi hiện lên nó còn ra hàng chục cái Mes_box kiểu thế này :
Function registration failed - duplicate name - [red]gd_info [/red] : chỗ này thay đổi
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.
For more information as to why this behaviour exists, see the manual page for CGI security.
For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.
PHP Warning: Unknown(): Unable to load dynamic library 'C:\PHP\Extensions\php_gd2.dll' - Access is denied. in Unknown on line 0
Mặc dù đã phân quyền (all) cho nó rồi (cả folder và IIS) nhưng nó vẫn báo Access is denied.
Các pác giúp đỡ nhé. Thanks