PHP 5.4.12 Mac OSX imagecreate *功能无法正常工作

时间:2013-03-03 15:29:58

标签: php apache gd macports imagecreatefrompng

我在Mac OSX 10.7.5上使用Apache 2(Apache / 2.2.24(Unix)mod_ssl / 2.2.24 OpenSSL / 1.0.1e DAV / 2 PHP / 5.4.12)从macports运行PHP 5.4.12。 5天前,这段代码工作正常(是的,直接来自PHP网站):

<?php
header ('Content-Type: image/png');
$im = @imagecreatetruecolor(120, 20)
      or die('Cannot Initialize new GD image stream');
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);
imagepng($im);
imagedestroy($im); 
?>

我关上笔记本电脑。然后在3天后打开它,使用此代码进入我的测试页面,它不再有效但我没有错误。我看到了破碎的图像而不是生成的图像。我今天升级了所有的软件和库。这就是phpinfo关于GD Lib的说法:

GD Support  enabled
GD Version  bundled (2.0.34 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
FreeType Version    2.4.10
GIF Read Support    enabled
GIF Create Support  enabled
JPEG Support    enabled
libJPEG Version unknown
PNG Support enabled
libPNG Version  1.5.14
WBMP Support    enabled
XBM Support enabled

phpinfo()报告了我的php安装:

'./configure' '--prefix=/opt/local' '--mandir=/opt/local/share/man' 
'--infodir=/opt/local/share/info' '--program-suffix=54' 
'--includedir=/opt/local/include/php54' '--libdir=/opt/local/lib/php54' 
'--with-config-file-path=/opt/local/etc/php54' 
'--with-config-file-scan-dir=/opt/local/var/db/php54' '--disable-all' '--enable-bcmath' 
'--enable-ctype' '--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-hash' 
'--enable-json' '--enable-libxml' '--enable-pdo' '--enable-phar' '--enable-session' 
'--enable-simplexml' '--enable-tokenizer' '--enable-xml' '--enable-xmlreader' 
'--enable-xmlwriter' '--with-bz2=/opt/local' '--with-mhash=/opt/local' 
'--with-pcre-regex=/opt/local' '--with-libxml-dir=/opt/local' '--with-zlib=/opt/local' 
'--without-pear' '--disable-cgi' '--disable-cli' '--disable-fpm' 
'--with-apxs2=/opt/local/apache2/bin/apxs'

我注意到那里没有'--with-gd',但我在这个代码工作和破解之间没有对PHP进行任何更改......

完全有可能当我关闭笔记本电脑然后重新打开时,apache重启了。我没有安装或升级任何东西(绝对没有改变php)或对任何ini文件进行任何更改或升级过去的任何东西。然而,今天,我确实对使用macports安装的所有内容进行了全面升级。没有解决问题。

是否有其他人遇到此问题/寻找解决方案?

0 个答案:

没有答案
相关问题