我试图呈现一个页面上的验证码图片如下:无法呈现在PHP(的Apache2)动态创建的图像
<img src="part/captcha_image.php?rand=<?php echo rand(); ?>" id='captchaimg' alt="captcha image">
图片则返回captcha_image.php
有:
header('Content-Type: image/jpeg'); // defining the image type to be shown in browser widow
imagejpeg($image); //showing the image
并在XMPP上的Windows机器上显示没有任何问题,但在Linux上与手动apache2安装图像不呈现,并在浏览器的开发人员的工具,我看到以下错误:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
http://localhost/app/part/captcha_image.php?rand=1653484771 Failed to load resource: net::ERR_CACHE_MISS
(仅在Chrome显示)(在Chrome和Firefox所示)
我缺少什么?
您正在使用chrome,对吗?请参阅:http://stackoverflow.com/questions/26408931/bizarre-error-in-chrome-developer-console-failed-to-load-resource-neterr-ca&https://code.google.com/p/铬/问题/细节?id = 424599 – wolfemm 2014-11-03 21:26:44
这是正确的。我已经在Firefox上测试了我的页面,并编辑了我的问题并提供了结果(ERR_CACHE_MISS未在Firefox上显示) – Disper 2014-11-03 21:40:38
您是否使用gd模块安装了php? – Cheery 2014-11-03 21:54:47