任何人在XAMPP中使用Google图表时遇到问题? [英] Anyone having problems with Google charts in XAMPP?

查看:119
本文介绍了任何人在XAMPP中使用Google图表时遇到问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用POST示例,找到此处



在Windows 7机器上,它不显示图表,只是图像的ALT文本(我添加到示例中)。当我将两个文件上传到我的网站时,它工作得很好。



其他人有没有用XAMPP试过这个?会有人吗?如果它在localhost上适合你,你可以粘贴你的文本页面的全部代码,我会奖励答案。谢谢。




顺便说一句:这是我的测试页。其他文件 chartserver-image.php 与Google的页面一致

  <?php 
echo<!DOCTYPE HTML PUBLIC \ - // W3C // DTD HTML 4.01 // EN \\http://www.w3.org/TR/html4 /strict.dtd\\">;
回显< html>;
echo< head>;
echo< title>我的Google图表在哪里?< / title>;
echo< meta http-equiv = \Content-type \content = \text / html; charset = UTF-8 \>;
echo< meta HTTP-EQUIV = \Pragma \CONTENT = \no-cache \>;
echo< meta HTTP-EQUIV = \Expires \CONTENT = \-1 \>;
echo< style type = \text / css \>;
echobody {font:12px Arial;};
echo< / style>;
echo< / head>;
echo< body>;

echo< div>;
echo< img width ='600'height ='200'src ='chartserver-image.php'alt ='alt text'>;
回显< / div>;

echo< / body>;
回显< / html>;
?>


解决方案

http://php.net/fopen =nofollow noreferrer> fopen 对HTTP请求的包装设置不正确。那么chartserver-image.php就会打开fopen请求。

因此,在你的浏览器中,直接进入这个链接:

  http://localhost/path/to/file/chartserver-image.php 

请记住相应地更改路径。你会看到错误和发生了什么。顺便说一句,它与您发布的代码无关。


I use the example for POST, found here.

On a windows 7 machine it doesn't show the chart, just the image's ALT text (which I added to the example). When I upload the two files to my website it works just fine.

Has anyone else tried this with XAMPP? Would someone? If it works for you on localhost can you please paste the entire code of your text page & I will award the answer. Thanks.


Btw: here's my test page. The other file chartserver-image.php is as per Google's page

<?php 
  echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\"http://www.w3.org/TR/html4/strict.dtd\">";  
  echo "<html>";  
  echo "<head>";  
  echo "<title>Where's my Google Chart, then?</title>";  
  echo "<meta http-equiv=\"Content-type\" content=\"text/html;charset=UTF-8\">";  
  echo "<meta HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">";  
  echo "<meta HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">";  
  echo "<style type=\"text/css\">";  
  echo "  body { font: 12px Arial; }";  
  echo "</style>";  
  echo "</head>";  
  echo "<body>";  

  echo "<div>";  
  echo "<img width='600' height='200' src='chartserver-image.php' alt='alt text'>";  
  echo "</div>";  

  echo "</body>";
  echo "</html>";
?>

解决方案

Most probably, the fopen wrappers are not set correctly for HTTP requests. As the chartserver-image.php makes the fopen request.

So, in your browser, directly go to this link:

 http://localhost/path/to/file/chartserver-image.php

Remember to change the path accordingly. You will see the error and what's going on. BTW, it has nothing to do with the code you posted.

这篇关于任何人在XAMPP中使用Google图表时遇到问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆