A few tips on PHP jpgraph (with installation method)
The GD library in PHP itself is a very powerful drawing library. The images drawn can basically meet daily requirements. However, it is powerful and powerful, and it is not convenient enough. Because the powerful and convenient jpgraph based on PHP's GD library was born. !
PHP does not enable the GD library by default because the extension=php_gd2.dll comment needs to be turned on in the php.ini configuration file. After opening it, you can draw some weird patterns you want to draw. What? Can't draw? Then go back and learn the basics!
Today I watched a video from a training institution and the jpgraph report. According to the video method, I downloaded Version: 3.0.7 from http://jpgraph.net/download/. After decompressing it, I downloaded it in Examples Create a jpgraph directory under the directory, and cut all the files in the src directory except Examples into the newly created jpgraph directory under the Examples directory. Then copy Examples to the directory configured by apache.
But after trying for a long time, I kept getting an error message:
Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in H:TestFileExamplesjpgraphjpgraph.php on line 391
JpGraph Error: HTTP headers have already been sent.
Caused by output from file jpgraph.php at line 392.Explanation:
HTTP headers have already been sent back to the browser indicating the data as text before the library got a chance to send it's image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser ( since that would be interpreted as text by the browser and show up as junk text).
Most likely you have some text in your script before the call to Graph::Stroke(). If this texts gets sent back to the browser the browser will assume that all data is plain text. Look for any text, even spaces and newlines, that might have been sent back to the browser.
For example it is a common mistake to leave a blank line before the opening "
After reporting a bunch of Warnings above, an error appeared: JpGraph Error. So, the blogger who was not good at English simply sent this pile of English to Baidu Translate. I still didn’t understand it, so I looked for it online. No one answered Dui, so I found it after searching on Google. http://bbs.php100.com/simple/?t294044.html, the answer is probably about the time zone, and the solution is also given. Just use date_default_timezone_set('Asia/Chongqing'); to set the corresponding time zone, here It is set to Chongqing. The problem will be solved accordingly.
Then I downloaded jpgraph of Version: 3.5.0b1 and tried it in the same way. The picture on the homepage still could not be loaded. The reason was that there was no 'jpgraph/jpgraph_odo.php' file, which caused problems when importing it. , and the blogger searched the Internet for the corresponding files and copied them to the jpgraph directory, but still could not solve the problem, and finally let it go.
http://www.bkjia.com/PHPjc/909452.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/909452.htmlTechArticleA little tip for PHP jpgraph (with installation method) The GD library in PHP itself is a very powerful drawing tool The library is available, and the images drawn can basically meet daily requirements, but it is powerful and powerful...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn