PHP jpgraph a little hint (attached installation method)

Source: Internet
Author: User

PHP in the GD library itself is a very powerful drawing library, drawing the image can meet the daily requirements, but strong regulation is strong, or not convenient ha, because the powerful and convenient PHP-based GD Library Jpgraph is also born!

PHP does not enable the GD library by default, because the Extension=php_gd2.dll comment needs to be opened in the PHP.ini configuration file. After opening, you can draw some of the wonderful patterns you want to draw. What the? Can't draw? Then go back to learning the basics!

Today saw a video of a training organization, read the Jpgraph report this piece, according to the video method, in http://jpgraph.net/download/downloaded the version:3.0.7 version, After decompression, create a jpgraph directory under the examples directory and cut all files except examples in the SRC directory into the jpgraph directory you just created under the examples directory. Then copy the examples to the directory configured by Apache.

But the results of a half-day trial, old error:

Warning : strftime (): It is not safe for rely on the system ' s timezone settings. You is *required* to use the Date.timezone setting or the Date_default_timezone_set () function. In case you used any of those methods and you is still getting this warning, your most likely misspelled the timezone Iden Tifier. We selected the timezone ' UTC ' for now, but please set Date.timezone to select your timezone. In H:\TestFile\Examples\jpgraph\jpgraph.php on line 391

jpgraph Error: HTTP headers has already been sent.
caused by output from the file jpgraph.php at line 392. Explanation:
HTTP headers has already been sent back to the browser indicating the data as text before the library got a chance to Sen D It ' s image HTTP header to this browser. This makes it impossible for the library to send back image data to the browser (since, would be interpretated as text By the browser and show up as junk text).

Most likely are some text in your script before the call to Graph::stroke (). If This texts gets sent back to the browser the browser would assume that all data is plain text. Look for any text, even spaces and newlines, that might has been sent back to the browser.

For example it was a common mistake to leave a blank line before the opening "<?php".

The above warning reported a pile, there was a mistake: jpgraph error, so, English poor blogger simply put this pile of English to Baidu translation, simply still did not understand, online find a bunch is no answer, after Google under Search to find. Http://bbs.php100.com/simple/?t294044.html, the answer is probably the time zone what problem, also gives the solution with Date_default_timezone_set (' asia/chongqing ' ); Set the corresponding time zone, which is set to Chongqing. The problem will be solved with it.

Then downloaded the version:3.5.0b1 jpgraph, the same way to try it, the picture on the home page is still not loaded, because there is no ' jpgraph/jpgraph_odo.php ' this file, resulting in the introduction of a problem, and bloggers to the web search for the corresponding documents also copied to the Jpgraph directory, but also failed to resolve, and finally nothing.

Is there a workaround no?

PHP jpgraph a little hint (attached installation method)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.